I use js2-mode with emacs-prelude, imenu displays the list of functions and I can collapse and uncollapse the functions defined in a regular js file like this
function testFunction1(){
console.debug("test function");
}
function testFunction2(arg1, arg2){
console.debug("test function2");
}
It however doesn't work on a angular js file
'use strict';
app.controller('TestController', ['$scope', 'TestService',
function($scope, TestService){
function testFunction1(obj) {
console.debug("Test Function");
}
var testVariable = {
'field1': 'val1',
'field2': 'val2'
};
$scope.scopeFunction1 = function(){
console.debug("Scope Function ");
};
$scope.scopeVar ={
'field1': 'val1',
'field2': 'val2'
};
}]);
It doesn't recognize - testFunction1 or scopeFunction1 as a function, they are not displayed on the iMenu and I couldn't collapse/uncollapse them. How can we configure emacs for working with angular js files.