18
rated 0 times
[
25]
[
7]
/ answers: 1 / hits: 17149
/ 9 Years ago, thu, april 9, 2015, 12:00:00
Newbie to AngularJS and trying to create a simple directive. The code fails with a
TypeError: Cannot read property 'compile' of undefined. Any suggestions would be greatly appreciated.
JS
var xx = angular.module('myApp', []);
xx.directive('myFoo',
function(){
return
{
template:'23'
};
});
HTML
<div ng-app=myApp>
<div my-foo></div>
</div>
You can find the code and error here https://jsfiddle.net/p11qqrxx/15/
More From » angularjs