<!DOCTYPE html>
<html>
<head>
<title>Angullr</title>
</head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp">
<div ng-controller="newController">
{{hello}}
<div my-direcitve></div>
</div>
</div>
</body>
<script type="text/javascript">
(function() {
dir = angular.module('mydirective',[]);
dir.directive('myDirecitve', function() {
return {
template: '<ul><li>No Hello</li></ul>'
};
});
});
var app = angular.module('myApp',['mydirective']);
app.controller('newController',function($scope,myDirecitve){
$scope.hello = 'hello Wolrd';
});
</script>
</html>
Failed to instantiate module myApp due to: Error: [$injector:modulerr] http://errors.angularjs.org/1.4.8/$injector/modulerr?p0=m...) at Error (native)
()to me? - Hopeful Llama()as above or move all logic outside . - Tan Le