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

Unified Diff: third_party/pkg/angular/demo/web/main.dart

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/demo/web/index.html ('k') | third_party/pkg/angular/demo/web/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/demo/web/main.dart
diff --git a/third_party/pkg/angular/demo/web/main.dart b/third_party/pkg/angular/demo/web/main.dart
deleted file mode 100644
index d9a1a606024e58709cbd0927c648eba530181b13..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/demo/web/main.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-import 'dart:html' as dom;
-import 'dart:math' as math;
-
-import 'package:angular/angular.dart';
-import 'package:di/di.dart';
-
-class BookController {
- Scope $scope;
- List chapters;
-
- attach(Scope scope) {
- $scope = scope;
-
- $scope.greeting = 'TabController';
- chapters = [];
- $scope.chapters = chapters;
-
- $scope.selected = (chapterScope) {
- chapters.forEach((p) {
- p['selected'] = false;
- });
- chapterScope['selected'] = true;
- };
- }
-
- addChapter(var chapterScope) {
- if (chapters.length == 0) { ($scope.selected)(chapterScope); }
- chapters.add(chapterScope);
- }
-}
-
-class BookComponent {
- BookController controller;
- BookComponent(BookController this.controller);
-
- static String $templateUrl = 'book.html';
- static String $cssUrl = 'book.css';
-
- attach(Scope scope) {
- controller.attach(scope);
- }
-}
-
-class ChapterDirective {
- BookController controller;
- dom.Element element;
- ChapterDirective(dom.Element this.element, BookController this.controller);
-
- attach(Scope scope) {
- // automatic scope management isn't implemented yet.
- var child = scope.$new();
- child.title = element.attributes['title'];
- controller.addChapter(child);
- }
-}
-
-@NgDirective(
- selector: '[main-controller]'
-)
-class MainController {
-
- String _random = 'Random: ${new math.Random().nextInt(100)}';
-
- MainController(Scope scope) {
- scope['greeting'] = 'Hello world!';
- scope['people'] = ['James', 'Misko'];
- scope['objs'] = [{'v': 'v1'}, {'v': 'v2'}];
- scope['random'] = () {
- return _random;
- };
- }
-}
-
-main() {
- // Set up the Angular directives.
- var module = new Module()
- ..type(BookComponent)
- ..type(ChapterDirective)
- ..type(MainController);
-
- ngBootstrap(module:module);
-}
« no previous file with comments | « third_party/pkg/angular/demo/web/index.html ('k') | third_party/pkg/angular/demo/web/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698