Search code examples
apiangularjs-directiveraml

RAML api-console is not loading the api.raml file


I am trying to get the RAML api-console working like this:

<html>
  <head>
    <link rel="stylesheet" href="styles/api-console-light-theme.css" type="text/css"/>
  </head>
  <body ng-app="ramlConsoleApp" ng-cloak>
    <script type="text/javascript" src="scripts/api-console-vendor.js"></script>
    <script type="text/javascript" src="api-console.js"></script>

    <div style="overflow:auto;position:relative;">
      <raml-console src="api.raml"></raml-console>
    </div>

  </body>
</html>    

It seems like the part src="api.raml" is not doing anything.

All other parts work fine. For instance, adding the attribute disable-theme-switcher removes the "switch theme" button from the page.

There are no errors in the console and the "network" tab in the Chrome developer tool does not show a failed download. So it seems the application is not even trying to load the file.


Solution

  • Try using <raml-console-loader src="api.raml"></raml-console-loader> instead of <raml-console src="api.raml"></raml-console>. Note that additional directives such as disable-theme-switcher are not working in this new tag as of the current state of the raml-1.0 branch. You can see relevant issues #278, #284, and 286.