Skip to content

Instantly share code, notes, and snippets.

@Hacklone
Hacklone / angular2-cool-loading-indicator-code.ts
Last active May 24, 2017 13:30
angular2-cool-loading-indicator-code
import { CoolHttp } from 'angular2-cool-http';
@Component({
selector: 'my-app',
template: `
<div>
{{ data }}
</div>
`
})
@Hacklone
Hacklone / angular2-cool-loading-indicator-template.html
Last active May 24, 2017 13:27
angular2-cool-loading-indicator-template
<cool-loading-indicator [indicatorDelay]="500">
<div>This is you incredible custom loading indicator element</div>
</cool-loading-indicator>
@Hacklone
Hacklone / angular2-cool-loading-indicator-custom.ts
Created May 24, 2017 13:14
angular2-cool-loading-indicator-custom
@Component({
selector: 'my-app',
template: `
<div *ngIf="showLoadingIndicator" class="my-loading-indicator">
</div>
`
})
export class MyAppComponent {
constructor(private http: Http) {
}
@Hacklone
Hacklone / angular2-cool-http-usage.ts
Created November 27, 2016 21:37
angular2-cool-http is easy
constructor(private _http: CoolHttp) { }
async ngOnInit() {
// await async api call
const response = await this._http.getAsync('/api/request');
console.log(response);
}