javascript - Angular VS 2015 MVC Custom Directive unexpected identifier and expected ; errors -


this question has answer here:

i missing boat on error. simplistic of implementation of custom directive throws precompiler errors , on execution throws same errors.

since version issue here think relevant if not tell me , i'll add info.

angular 1.4.8

angular.min.js angular-route.min.js 

vs 2015 & .net 4.5

app-mainnav.js

1.    (function () 2.    { 3.  "use-strict"; 4. 5.  angular.module("app-mainnav", []) 6.      .directive("dashboard-main-nav", function () 7.      { 8.          return 9.          { 10.             restrict:"e", 11.             templateurl:"/navigation/getdashitems", 12.             link:function(){} 13.         } 14.     }); 15.    })(); 

at colon of line 11 & 12 expected ; errors. @ line 12 expected identifier function() line 10 never has issues no matter order.

if remove comma on line 10 & 11 expected ; error goes away...but flies in face of every tutorial have seen on custom angular directives.

further no matter i've tried unexpected identifier not go away.

sorry if obtuse...not trying baffled. let me know information , i'll gladly include it.

return statement terminates newline, use:

return {   ... } 

see what rules javascript's automatic semicolon insertion (asi)?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -