Skip to content

Angular Explorer View

Angelo edited this page Jan 10, 2014 · 12 revisions

Angular Explorer View

Angular Explorer View gives you the capability to display lits of modules and controllers of your AngularJS application :

Angular Explorer view

This view is usefull for :

  • display modules, controllers, etc in a view and go to the definition if you double click on it (open the JS editor and select the module, controller).
  • AngularJS "HTML templates" where module and controller is not defined inside the HTML. So you can link module and controller to the current HTML editor to benefit with Angular expression completion.

How to configure the view?

Define script path

Script path is configurated in the Tern Project properties

Configure script path

Open "Angular Explorer" View

Open Angular Explorer view

Use the Angular Explorer view?

Go To Definition

The "Go To Definition" contextual menu gives the capability to open the JS editor and select the module, controller selected (you can do that too with double click) :

Go To Definition

HTML Template (Link/Unlink)

If you try to open completion inside angular expression in HTML Template (like https://github.com/angular/angular-phonecat/tree/master/app/partials), you will notice that completion doesn't work:

Controller Link 1

Indeed, a HTML Template file doesn't include some scripts (with script elements) and doesn't define a controller in the HTML page (with ngController directive attribute name) : completion doesn't know which controller to use to retrieve model from the $scope of the controller.

To resolve this problem, you can link the HTML file to a controller with "Link to Controller" menu action from teh "Angular Explorer" view :

Controller Link 2

After linking the HTML page with a controller, completion works now inside angular expression :

Controller Link 3