javascript - Directive syntax error on enter/return -
noob alert
this weird - trying create custom directive in angularjs, when write code:
mymodule.directive('mytab', function(){ console.log('--inside tab directive--'); return { template: '<div>hello world</div>' }; });
it throws exception: typeerror: cannot read property 'compile' of undefined
however, code runs fine:
mymodule.directive('mytab', function(){ console.log('--inside tab directive--'); return { template: '<div>hello world</div>' }; });
the difference opening curly brace on next line in first code. behaviour normal?
because returning function , next line ignored. literally see return, , return undefined
Comments
Post a Comment