0
votes

I am trying to make an angular module created inside a meteor package become visible to my application. Below are the steps I performed:

1) create a package with the file mod-1.ng that registers a module

angular.module('mod-1', []);

2) added the file through package.js

Package.onUse(function(api) {
  api.addFiles(['mod-1.ng'], ['client']);
});

3) included the module dependency on my application code

angular.module('my-app', ['mod-1']);

Angular complains upon application startup

Error: [$injector:nomod] Module 'mod-1' is not available! (...)

How can I make this angular module available to my application ?

EDIT: this repository link may help reproduce the problem: https://github.com/ccortezia/angular-meteor-packaged-modules/tree/problem-1

1
Why don't use use .ng.js ? or just .js ?Urigo
@Urigo, for some reason, at some point on my previous project I had to change from .js to .ng. I cannot even recall the reason anymore, but I'd totally rather use .js.ccortezia
You don't have to, the only reason to use .ng.js is to automatically get ng-annotateUrigo

1 Answers

0
votes

Using .ng.js extension on javascript files solved the problem.

In the past I used jnissi:ng-annotate, which happens to require .js files to be renamed to .ng. Nowadays angular-meteor seems to have it handled automatically by detecting and annotating files with extension .ng.js.