marijnh/tern — pull request #258 by angelozerr (2013-11-26 14:55:24+00:00)
Title: Manage fieldType ('controller', 'service', etc) in the injector.fields.

This patch add "type"in the field of injector.fields to know if the field comes from 'controller', 'service', etc.
I would like to develop a new plugin html-angular.js which is enable to retrieve list of modules, list of controller, etc for completion, validation features (to manage completion in HTML editor to retrieve list of modules (ng-app), etc).

For the moment I have written a little javascript function which displays list of modules and list of controller :

function display() {
// list of modules
var _angular = server.server.cx.parent._angular;
if (_angular && _angular.modules) {
for (var moduleName in _angular.modules) {

// display list of modules
var module = _angular.modules[moduleName];
alert(moduleName);

// display list of controller
var fields = module.injector.fields;
for (var fieldName in fields) {
var field = fields[fieldName];
if (field.type == 'controller')
alert("controller=" + fieldName);
}
}
}

So at this step, I can manage completion for modules and controller. After that I would like to manage completion for ng-model (returns a list of $scope properties for a given controller, I must understand your injector.fields structure to manage that)

Don't hesitate to tell me, if I'm wrong. Thank's!