Since version 1.2.0 and above, the default behaviour with is using Angular compilation for regular
html
andjs
files.You just need to
meteor remove blaze-html-templates ecmascript
So ng-annotate and angular-babel is activated by default for all
js
files and $templateCache by default for allhtml
files.If you want to keep using Blaze with Angular you should use the
angular-with-blaze
package instead of theangular
package, don't removeblaze-html-templates
and keep reading this file about.ng.js
andng.html
If you want to avoid minification problems with Angular's dependency annotations, you normally need to use a syntax that you're probably already familiar with:
angular.module('socially').controller('PartiesListCtrl', ['$scope',
function($scope){
// ...
}]);
There is a very popular Angular tool called ng-annotate that automatically adds and removes AngularJS dependency injection annotations. Angular-meteor uses that process automatically. All you need to do is to change your .js
files to end with .ng.js
. Those files will be recognised by Angular-meteor and automatically corrected, so you can simply write your dependency injection like this:
angular.module('socially').controller('PartiesListCtrl',
function($scope){
// ...
});
Both Blaze (Meteor's templating system) and AngularJS use the same braces or 'double curley brackets' syntax for expressions. That causes issues when you're working with AngularJS in Meteor: Blaze will compile and override your AngularJS expression. To disable that behaviour, you can use the .ng.html
file extension.