diff options
| author | Misko Hevery | 2012-04-28 22:45:28 -0700 |
|---|---|---|
| committer | Misko Hevery | 2012-05-04 16:12:17 -0700 |
| commit | 8e2675029f5ca404a7c649cc161df3ea642d941f (patch) | |
| tree | 6668342fb2c57360e06c9e36bfd4e5e6e08a52f5 /src/ng/directive/ngInclude.js | |
| parent | d0159454dfa2e1cee4dd4ab7a41c2fcf9e121a64 (diff) | |
| download | angular.js-8e2675029f5ca404a7c649cc161df3ea642d941f.tar.bz2 | |
chore(docs): re-skin main documentation
Diffstat (limited to 'src/ng/directive/ngInclude.js')
| -rw-r--r-- | src/ng/directive/ngInclude.js | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js index 9796b4e1..6d89e847 100644 --- a/src/ng/directive/ngInclude.js +++ b/src/ng/directive/ngInclude.js @@ -26,41 +26,47 @@ * - Otherwise enable scrolling only if the expression evaluates to truthy value. * * @example - <doc:example> - <doc:source jsfiddle="false"> - <script> - function Ctrl($scope) { - $scope.templates = - [ { name: 'template1.html', url: 'examples/ng-include/template1.html'} - , { name: 'template2.html', url: 'examples/ng-include/template2.html'} ]; - $scope.template = $scope.templates[0]; - } - </script> - <div ng-controller="Ctrl"> - <select ng-model="template" ng-options="t.name for t in templates"> - <option value="">(blank)</option> - </select> - url of the template: <tt><a href="{{template.url}}">{{template.url}}</a></tt> - <hr/> - <div ng-include src="template.url"></div> - </div> - </doc:source> - <doc:scenario> - it('should load template1.html', function() { - expect(element('.doc-example-live [ng-include]').text()). - toBe('Content of template1.html\n'); - }); - it('should load template2.html', function() { - select('template').option('1'); - expect(element('.doc-example-live [ng-include]').text()). - toBe('Content of template2.html\n'); - }); - it('should change to blank', function() { - select('template').option(''); - expect(element('.doc-example-live [ng-include]').text()).toEqual(''); - }); - </doc:scenario> - </doc:example> + <example> + <file name="index.html"> + <div ng-controller="Ctrl"> + <select ng-model="template" ng-options="t.name for t in templates"> + <option value="">(blank)</option> + </select> + url of the template: <tt>{{template.url}}</tt> + <hr/> + <div ng-include src="template.url"></div> + </div> + </file> + <file name="script.js"> + function Ctrl($scope) { + $scope.templates = + [ { name: 'template1.html', url: 'template1.html'} + , { name: 'template2.html', url: 'template2.html'} ]; + $scope.template = $scope.templates[0]; + } + </file> + <file name="template1.html"> + Content of template1.html + </file> + <file name="template2.html"> + Content of template2.html + </file> + <file name="scenario.js"> + it('should load template1.html', function() { + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template1.html/); + }); + it('should load template2.html', function() { + select('template').option('1'); + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template2.html/); + }); + it('should change to blank', function() { + select('template').option(''); + expect(element('.doc-example-live [ng-include]').text()).toEqual(''); + }); + </file> + </example> */ |
