docs($compile): update example to use a module
This commit is contained in:
+7
-8
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user