Skip to content

Commit 1b23b24

Browse files
committed
update sample app with new feature
1 parent 8aed5da commit 1b23b24

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

sample/app/app.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ angular.module('uiRouterSample', [
9191
}, 100);
9292
}]
9393
})
94+
95+
.state('me', {
96+
url: '/me',
97+
template: "<h1>Me, <a ui-sref=\"giserman\">Giserman</a></h1>"
98+
})
99+
100+
.state('giserman', {
101+
parent: 'me',
102+
independent: true,
103+
url: '/giserman',
104+
views: {
105+
'giserman@': {
106+
template: "<h1>Giserman, <a ui-sref=\"^\">me</a></h1>"
107+
}
108+
}
109+
})
94110
}
95111
]
96112
);

sample/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- Include both angular.js and angular-ui-router.js-->
1313
<script src="../lib/angular-1.2.14/angular.js"></script>
1414
<script src="../lib/angular-1.2.14/angular-animate.js"></script>
15-
<script src="../release/angular-ui-router.js"></script>
15+
<script src="../build/angular-ui-router.js"></script>
1616

1717
<!-- app.js declares the uiRouterSample module and adds items to $rootScope, and defines
1818
the "home" and "about" states
@@ -50,6 +50,7 @@
5050
its descendant states are activated. -->
5151
<li ng-class="{active: $state.includes('contacts')}"><a ui-sref="contacts.list">Contacts</a></li>
5252
<li ui-sref-active="active"><a ui-sref="about">About</a></li>
53+
<li ui-sref-active="me"><a ui-sref="me">Me</a></li>
5354
</ul>
5455

5556
<!-- Here is a named ui-view. ui-views don't have to be named, but we'll be populate this
@@ -61,6 +62,7 @@
6162
<!-- Here is the main ui-view (unnamed) and will be populated by its immediate children's templates
6263
unless otherwise explicitly named views are targeted. It's also employing ng-animate. -->
6364
<div ui-view class="container slide" style="padding-top: 80px;"></div>
65+
<div ui-view="giserman" class="container slide"></div>
6466

6567

6668
<hr>

0 commit comments

Comments
 (0)