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 { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; | |
export class NewDriverComponent implements OnInit { | |
driver: FormGroup; | |
constructor(private fb: FormBuilder) { | |
} | |
createForm(): void { | |
this.driver = this.fb.group({ | |
firstName: ['', [Validators.required]], | |
lastName: ['', [Validators.required]], |
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
// Actions | |
import axios from 'axios'; | |
import * as types from '../constants/actionTypes'; | |
import { browserHistory } from 'react-router'; | |
import setAuth from '../radiomize/auth/setAuth'; | |
import jwt from 'jsonwebtoken'; | |
const AUTH_URL = 'http://dev.admin.api.radiomize.com/v1/login'; | |
const BASE_URL = 'http://dev.admin.api.radiomize.com/v1/'; | |
// TYPES OF ACTIONS |
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 default class Api { | |
static headers() { | |
return { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json', | |
'dataType': 'json', | |
} | |
} | |
static get(route) { |
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
const Actions = (type) => ({ | |
FETCH: { | |
IN_PROGRESS: `FETCH_${type}_IN_PROGRESS`, | |
SUCCESS: `FETCH_${type}_SUCCESS`, | |
ERROR: `FETCH_${type}_ERROR` | |
}, | |
POST: { | |
IN_PROGRESS: `POST${type}_IN_PROGRESS`, | |
SUCCESS: `POST${type}_SUCCESS`, | |
ERROR: `POST${type}_ERROR` |
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
const spacingFactor = 8; | |
export const spacing = { | |
space0: `${computeGoldenRatio(spacingFactor, 0)}px`, // 8 | |
space1: `${computeGoldenRatio(spacingFactor, 1)}px`, // 13 | |
space2: `${computeGoldenRatio(spacingFactor, 2)}px`, // 21 | |
space3: `${computeGoldenRatio(spacingFactor, 3)}px`, // 34 | |
space4: `${computeGoldenRatio(spacingFactor, 4)}px`, // 55 | |
space5: `${computeGoldenRatio(spacingFactor, 5)}px`, // 89 | |
}; |
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
package fitnesse.html; | |
import fitnesse.responders.run.SuiteResponder; | |
import fitnesse.wiki.*; | |
public class SetupTeardownIncluder { | |
private PageData pageData; | |
private boolean isSuite; | |
private WikiPage testPage; | |
private StringBuffer newPageContent; | |
private PageCrawler pageCrawler; |
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
//src/common/services/interceptor.service.ts | |
import { environment } from '../../../environments/environment'; | |
import { Injectable } from '@angular/core'; | |
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { Observable } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class Interceptor implements HttpInterceptor { |
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
//src/common/services/api.service.ts | |
@Injectable({ providedIn: 'root' }) | |
export class ApiService { | |
monitor = "/monitor"; | |
analytics = "/analytics"; | |
api = "/api" | |
constructor(private httpClient: HttpClient) { } | |
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 ProductComponent implements OnInit { | |
product$: Observable<Product>; | |
constructor(private api: ApiService,private route:ActivatedRoute) {} | |
ngOnInit() { | |
const id = this.route.snapshop.params['id']; | |
this.product$ = this.api.product(id); | |
// ... | |
} |
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
@Injectable() | |
export class ProductResolver implements Resolve<Product> { | |
constructor(private api: ApiService) {} | |
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Product> { | |
return this.api.product(route.params['id']); | |
} | |
} |
OlderNewer