mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-04 05:04:44 +00:00
docs(ng-view): improve the ng-view docs
This commit is contained in:
parent
1b4289ce76
commit
7f6c1093f5
1 changed files with 9 additions and 3 deletions
|
|
@ -485,7 +485,7 @@ var ngNonBindableDirective = ngDirective({ terminal: true });
|
||||||
* Every time the current route changes, the included view changes with it according to the
|
* Every time the current route changes, the included view changes with it according to the
|
||||||
* configuration of the `$route` service.
|
* configuration of the `$route` service.
|
||||||
*
|
*
|
||||||
*
|
* @scope
|
||||||
* @example
|
* @example
|
||||||
<doc:example module="ngView">
|
<doc:example module="ngView">
|
||||||
<doc:source>
|
<doc:source>
|
||||||
|
|
@ -502,8 +502,14 @@ var ngNonBindableDirective = ngDirective({ terminal: true });
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
angular.module('ngView', [], function($routeProvider, $locationProvider) {
|
angular.module('ngView', [], function($routeProvider, $locationProvider) {
|
||||||
$routeProvider.when('/Book/:bookId', {template: 'examples/book.html', controller: BookCntl});
|
$routeProvider.when('/Book/:bookId', {
|
||||||
$routeProvider.when('/Book/:bookId/ch/:chapterId', {template: 'examples/chapter.html', controller: ChapterCntl});
|
template: 'examples/book.html',
|
||||||
|
controller: BookCntl
|
||||||
|
});
|
||||||
|
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
|
||||||
|
template: 'examples/chapter.html',
|
||||||
|
controller: ChapterCntl
|
||||||
|
});
|
||||||
|
|
||||||
// configure html5 to get links working on jsfiddle
|
// configure html5 to get links working on jsfiddle
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode(true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue