Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: third_party/pkg/route_hierarchical/example/full/company-info.dart

Issue 180873006: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 library companyinfo;
2
3 import 'dart:async';
4 import 'dart:html';
5
6 import 'package:route_hierarchical/client.dart';
7 import 'package:web_ui/web_ui.dart';
8
9 import 'index.dart';
10
11
12 class CompanyInfoComponent extends WebComponent {
13 var company;
14 RouteHandle route;
15 @observable String section;
16 @observable String infoUrl;
17 @observable String activitiesUrl;
18 @observable String notesUrl;
19
20 inserted() {
21 route.getRoute('info').onRoute.listen((_) => showSection('info'));
22 route.getRoute('activities')
23 .onRoute.listen((_) => showSection('activities'));
24 route.getRoute('notes')
25 ..onRoute.listen((_) => showSection('notes'))
26 ..onLeave.listen(notesLeave);
27
28 infoUrl = router.url('info', startingFrom: route);
29 activitiesUrl = router.url('activities', startingFrom: route);
30 notesUrl = router.url('notes', startingFrom: route);
31 }
32
33 removed() {
34 route.discard();
35 }
36
37 notesLeave(RouteEvent e) {
38 e.allowLeave(new Future.value(window.confirm('Are you sure you want ' +
39 'to leave?')));
40 }
41
42 showSection(section) {
43 this.section = section;
44 }
45
46 gotoSection(section, e) {
47 if (e != null) {
48 e.preventDefault();
49 }
50 router.go(section, {}, startingFrom: route).then((allowed) {
51 if (allowed) {
52 showSection(section);
53 }
54 });
55 }
56
57 String activeClass(sect) {
58 if (sect == section) {
59 return "active";
60 }
61 return "";
62 }
63 }
OLDNEW
« no previous file with comments | « third_party/pkg/route_hierarchical/REVISION ('k') | third_party/pkg/route_hierarchical/example/full/company-info.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698