This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FINE: Pub 1.15.0 | |
| MSG : Resolving dependencies... | |
| SLVR: Solving dependencies: | |
| | - angular2 2.0.0-beta.15 from hosted (angular2) (locked to 2.0.0-beta.15) | |
| | - polymer 1.0.0-rc.16 from hosted (polymer) (locked to 1.0.0-rc.16) | |
| SLVR: * start at root | |
| SLVR: | angular2 2.0.0-beta.15 from hosted is locked | |
| SLVR: | * select angular2 2.0.0-beta.15 from hosted | |
| SLVR: | | * select pub itself | |
| SLVR: | | | analyzer 0.27.1 from hosted is locked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "dart:async"; | |
| import "dart:math" as math; | |
| const asyncDelay = const Duration(seconds: 3); | |
| ///Asynchronous method that returns back a random int | |
| Future<num> getNumber(num max) { | |
| return new Future.delayed(asyncDelay, () => new math.Random().nextInt(max)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "dart:async"; | |
| main() async { | |
| print(" * Starting *"); | |
| Function elPrinter = (e) { print("Element $e");}; | |
| List<int> numbers = new List<int>.generate(10, (i) => i); // 0 - 9 | |
| Stream<int> numberStream = new Stream.fromIterable(numbers); | |
| numberStream.map((x) => x * 10) //0,10,20,30... | |
| .expand((x) => [x, x+1,x+2,x+3 ]) //0,1,2,3,10,11,12,13... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d(id) => new Document(id.toString()); //convenience function | |
| List<Document> docs = [d('Foo'), d('bar'), d('BIZ'), d('Baz'), d('fab')]; | |
| ///A simple document class with id | |
| class Document { | |
| String id; | |
| Document(this.id); | |
| toString() => id; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Adder implements Function { | |
| call(int a, int b) => a + b; | |
| } | |
| class Incrementer implements Function { | |
| int _amt; | |
| Incrementer(this._amt); | |
| call(int a) => a + _amt; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'dart:math' as math; | |
| var rnd = new math.Random(); | |
| ///Asynchronous method that returns back a random int | |
| Future<int> getNumber(num max) { | |
| return new Future.delayed(new Duration(seconds: rnd.nextInt(3)), () => rnd.nextInt(max)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:angular2/core.dart'; | |
| @Component( | |
| selector: 'my-fields', | |
| template: '<h2>Fields</h2>' | |
| ) | |
| class FieldsComponent { | |
| FieldsComponent(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:angular2/core.dart'; | |
| import 'package:angular2/router.dart'; | |
| import 'package:angular_dart_page_titles_on_route/page/fields_component.dart'; | |
| import 'package:angular_dart_page_titles_on_route/page/players_component.dart'; | |
| import 'package:angular_dart_page_titles_on_route/page/teams_component.dart'; | |
| @Component( | |
| selector: 'my-app', | |
| styleUrls: const ['app_component.css'], | |
| templateUrl: 'app_component.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <nav> | |
| <ul> | |
| <li><a [routerLink]="['Players']">Players</a></li> | |
| <li><a [routerLink]="['Teams']">Teams</a></li> | |
| <li><a [routerLink]="['Fields']">Fields</a></li> | |
| </ul> | |
| </nav> | |
| <div class="content" id="content"> | |
| <router-outlet></router-outlet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:angular2/core.dart'; | |
| import 'package:angular2/router.dart'; | |
| @Component( | |
| selector: 'my-player-detail', | |
| template: '''<h2>Player Detail</h2> <h3>{{player}}</h3>''', | |
| ) | |
| class PlayerDetailComponent implements OnInit { | |
| final RouteParams _routeParams; | |
| String player = "Not selected"; |
OlderNewer