diff --git a/public/docs/_examples/server-communication/dart/example-config.json b/public/docs/_examples/server-communication/dart/example-config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/server-communication/dart/lib/app_component.dart b/public/docs/_examples/server-communication/dart/lib/app_component.dart new file mode 100644 index 0000000000..55c91e6e4d --- /dev/null +++ b/public/docs/_examples/server-communication/dart/lib/app_component.dart @@ -0,0 +1,31 @@ +// #docplaster +// #docregion +import "package:angular2/core.dart" show Component; + +import "toh/hero_list_component.dart" show HeroListComponent; +import "wiki/wiki_component.dart" show WikiComponent; +import "wiki/wiki_smart_component.dart" show WikiSmartComponent; + +@Component( + selector: "my-app", + template: ''' + + + + ''', + // #enddocregion + /* + // #docregion http-providers + providers: const [ + // in-memory web api provider + const Provider(BrowserClient, + useFactory: HttpClientBackendServiceFactory, deps: const [])], + // #enddocregion http-providers + */ + // #docregion + directives: const [ + HeroListComponent, + WikiComponent, + WikiSmartComponent + ]) +class AppComponent {} diff --git a/public/docs/_examples/server-communication/dart/lib/hero_data.dart b/public/docs/_examples/server-communication/dart/lib/hero_data.dart index 50ec0fab1d..ae0480b98d 100644 --- a/public/docs/_examples/server-communication/dart/lib/hero_data.dart +++ b/public/docs/_examples/server-communication/dart/lib/hero_data.dart @@ -2,7 +2,7 @@ import 'package:http/browser_client.dart'; import 'package:http_in_memory_web_api/http_in_memory_web_api.dart'; -CreateDb createDb = () => { +CreateDb _createDb = () => { 'heroes': [ {"id": "1", "name": "Windstorm"}, {"id": "2", "name": "Bombasto"}, @@ -12,4 +12,4 @@ CreateDb createDb = () => { }; BrowserClient HttpClientBackendServiceFactory() => - new HttpClientInMemoryBackendService(createDb); + new HttpClientInMemoryBackendService(_createDb); diff --git a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart index 58fe0bb40c..23e1d6e9d7 100644 --- a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart +++ b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart @@ -9,7 +9,7 @@ import 'hero_service.dart'; @Component( selector: 'hero-list', templateUrl: 'hero_list_component.html', - styles: const ['.error {color:red;}']) + providers: const [HeroService]) // #docregion component class HeroListComponent implements OnInit { final HeroService _heroService; diff --git a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html index 86e2deedd6..297ffaa6c6 100644 --- a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html +++ b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html @@ -1,4 +1,5 @@ +

Tour of Heroes

Heroes: