docs($compile): update example to use a module

This commit is contained in:
Brian Ford
2014-07-07 13:53:14 -07:00
parent a0fad24dc2
commit dd18c00b1d
+7 -8
View File
@@ -389,10 +389,10 @@
* to illustrate how `$compile` works.
* </div>
*
<example module="compile">
<example module="compileExample">
<file name="index.html">
<script>
angular.module('compile', [], function($compileProvider) {
angular.module('compileExample', [], function($compileProvider) {
// configure new 'compile' directive by passing a directive
// factory function. The factory function injects the '$compile'
$compileProvider.directive('compile', function($compile) {
@@ -416,15 +416,14 @@
}
);
};
})
});
function Ctrl($scope) {
});
})
.controller('GreeterController', ['$scope', function($scope) {
$scope.name = 'Angular';
$scope.html = 'Hello {{name}}';
}
}]);
</script>
<div ng-controller="Ctrl">
<div ng-controller="GreeterController">
<input ng-model="name"> <br>
<textarea ng-model="html"></textarea> <br>
<div compile="html"></div>