Newbie Alert
I'm encountering something strange while attempting to create a custom directive in AngularJS. When I input this code:
myModule.directive('myTab', function(){
console.log('--Inside TAB directive--');
return
{
template: '<div>Hello World</div>'
};
});
An error is thrown saying: TypeError: Cannot read property 'compile' of undefined
However, if I use this code instead:
myModule.directive('myTab', function(){
console.log('--Inside TAB directive--');
return {
template: '<div>Hello World</div>'
};
});
The only difference between the two codes is that the opening curly brace is on the line below in the first one. Is this behavior normal?