How to define arrays in the interface and class properties in TypeScript
How-to's on using services, router and templates in Angular2
and many more coming...
1. How to define Array of complex items in interface
// see: https://gist.github.com/gdi2290/634101fec1671ee12b3e
interface TodoItem {
value: string;
created_at: Date;
completed?: boolean;
}
interface TodoList {
todos: Array< TodoItem >
private NEWS_URL: string = 'http://example.com/feed';
public static NEWS_URL_2: string = 'http://example.com/feed/common';
- http://chariotsolutions.com/blog/post/angular2-observables-http-separating-services-components/
- http://www.metaltoad.com/blog/angular-2-http-observables
- template link declaration
- necessary imports in component
import {RouteParams} from 'angular2/router';
- component class syntax for accessing route params
constructor(private _params: RouteParams) {
this.id = _params.get('STATE_PARAM');
}
- component syntax to navigate to a route:
this._router.navigate(['./STATE_NAME',{id:4 }]);
More details also in this detailed post on Router syntax julienrenaux.fr
- https://angular.io/cheatsheet
- http://victorsavkin.com/post/119943127151/angular-2-template-syntax
- http://blog.thoughtram.io/angular/2015/08/11/angular-2-template-syntax-demystified-part-1.html
6. How to communicate between components in Angular2
- http://stackoverflow.com/a/35878524/405623
- http://stackoverflow.com/questions/34376854/delegation-eventemitter-or-observable-in-angular2/35568924#35568924
- http://stackoverflow.com/a/36076701/405623
7. In depth Angular 2 lists of articles
- component relative paths in angular 2, COLD VS HOT OBSERVABLES, and links below those posts
No comments:
Post a Comment