From d28a0bf49e81037fd73d52449c04d571218fc787 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Mon, 7 Jul 2014 23:19:52 -0700 Subject: [PATCH] docs(ngInclude): update example to use a module --- src/ng/directive/ngInclude.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js index c4d20de3..2016a6a6 100644 --- a/src/ng/directive/ngInclude.js +++ b/src/ng/directive/ngInclude.js @@ -43,9 +43,9 @@ * - Otherwise enable scrolling only if the expression evaluates to truthy value. * * @example - + -
+
@@ -57,12 +57,13 @@
- function Ctrl($scope) { - $scope.templates = - [ { name: 'template1.html', url: 'template1.html'}, - { name: 'template2.html', url: 'template2.html'} ]; - $scope.template = $scope.templates[0]; - } + angular.module('includeExample', ['ngAnimate']) + .controller('ExampleController', ['$scope', function($scope) { + $scope.templates = + [ { name: 'template1.html', url: 'template1.html'}, + { name: 'template2.html', url: 'template2.html'} ]; + $scope.template = $scope.templates[0]; + }]); Content of template1.html