We have been developing a big product with AngularJS and only recently tried to use use closure compiler for syntax checking with the help of jsdoc comments.
I ran into this problem and can't find any help online, including in SO.
Consider a model class written as a service, and using the class name as a type:
ourmodule.factory('OurModel', function() {
/**
* @constructor
*/
var OurModel = function() {};
return OurModel;
});
ourmodule.controller('Controller1', ['$scope', 'OurModel', function($scope, OurModel) {
/**
* @return {OurModel}
*/
$scope.getNewModel = function () {
return new OurModel();
}
}]);
Closure compiler can't recognize 'OurModel'. What am I missing ?