This file contains 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 { Component, PLATFORM_ID , Inject} from '@angular/core'; | |
import { isPlatformServer } from '@angular/common' | |
import { TransferState , makeStateKey} from '@angular/platform-browser'; | |
import { HttpClient } from '@angular/common/http' | |
interface CounterState { | |
count: number; | |
} | |
const COUNTER_KEY = makeStateKey<CounterState>('my-counter'); |
This file contains 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
//usage | |
const MY_STORE_TOKEN = new InjectionToken('MY_STORE_TOKEN'); | |
@NgModule({ | |
providers: [ | |
//on the ServerModule you want to provide | |
//ServerStateTransferModule | |
BrowserStateTransferModule, | |
//helper function which will provide the store accosiated with this token |
This file contains 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
/** | |
* Created by Fabian on 19/10/2016. | |
*/ | |
import { Component, ElementRef, Input } from '@angular/core'; | |
import { Http } from '@angular/http'; | |
@Component({ | |
selector: 'file-upload', | |
template: '<input type="file" [attr.multiple]="multiple ? true : null" (change)="upload()" >' | |
}) | |
export class FileUploadComponent { |
NewerOlder