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

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -