So, I am using 1.20 rc2 and trying to implement the directive:
var directives = angular.module('directives', ['controllers']); directives.directive("drink", function() { return { template: '<div>{{flavor}}</div>', link: function(scope){ scope.flavor = "cherry"; } } });
the directive is called in the main JS file
var comsumerApp = angular.module('comsumerApp', ['ngRoute','controllers', 'services', 'directives']);
All controllers work the same way as services, but when I try to do this, I get this error:
"Uncaught SyntaxError: Unexpected token:"
then i get
$ injector: modulerr error.
Commenting on the drink directive stops this error, so obviously this has something to do with: or something.
Can anyone highlight this problem, I completely lost.
Thanks.
source share