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 'rxjs/add/operator/catch'; | |
| import 'rxjs/add/operator/map'; | |
| import { Injectable } from '@angular/core'; | |
| import { Headers, Http, Request, RequestOptions, Response, XHRBackend } from '@angular/http'; | |
| import { Router } from '@angular/router'; | |
| import { Observable } from 'rxjs/Observable'; | |
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
| export class AppModule { | |
| /** | |
| * Allows for retrieving singletons using `AppModule.injector.get(MyService)` | |
| * This is good to prevent injecting the service as constructor parameter. | |
| */static injector: Injector; | |
| constructor(public appState: AppState, injector: Injector) { | |
| AppModule.injector = injector; | |
| } | |
| } |
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 { Injectable } from '@angular/core'; | |
| import { RequestOptions, Response } from '@angular/http'; | |
| import { Observable } from 'rxjs/Rx'; | |
| import { HttpService } from '../../theme/services/http.service'; | |
| import { Error } from '../interfaces/error.interface'; | |
| import { ServerResponse } from '../interfaces/server-response.interface'; | |
| import { appVariables } from './../../app.constants'; | |
| import { CustomErrorHandlerService } from './custom-error-handler.service'; |
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
| export interface ServerResponse { | |
| data: any; | |
| error: string[]; | |
| message: string; | |
| } |
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 { Injectable } from '@angular/core'; | |
| import { Response, ResponseOptions } from '@angular/http'; | |
| import { Error } from '../interfaces'; | |
| import { TostNotificationService } from './toast-notification.service'; | |
| @Injectable() | |
| export class CustomErrorHandlerService { |
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 { Injectable } from '@angular/core'; | |
| import { Response } from '@angular/http'; | |
| import { Observable } from 'rxjs/Rx'; | |
| import { appApiResources } from '../../app.constants'; | |
| import { LoginResponse } from '../../theme/interfaces/login-response.interface'; | |
| import { HelperService } from '../../theme/services'; | |
| import { BaseService } from '../../theme/services/base.service'; | |
| @Injectable() |
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 {AfterViewInit, ChangeDetectorRef} from '@angular/core'; | |
| @Component(…) | |
| class AppComponent implements AfterViewInit { | |
| constructor(private cdr: ChangeDetectorRef) {} | |
| ngAfterViewInit() { | |
| // We only want to detach the change detectors after change detection has been | |
| // performed for the first time | |
| this.cdr.detach(); | |
| } |
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 {AfterViewInit, ChangeDetectorRef} from '@angular/core'; | |
| @Component(…) | |
| class AppComponent implements AfterViewInit { | |
| constructor(private cdr: ChangeDetectorRef) {} | |
| ngAfterViewInit() { | |
| // We only want to detach the change detectors after change detection has been | |
| // performed for the first time | |
| this.cdr.detach(); | |
| } |
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 {enableProdMode} from '@angular/core'; | |
| if (ENV === 'production') { | |
| enableProdMode(); | |
| } |
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
| var compression = require('compression') | |
| var express = require('express') | |
| var app = express() | |
| app.use(compression()) |
OlderNewer