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 { SwUpdate } from '@angular/service-worker'; | |
| import { PlatformService } from '../platform/platform.service'; | |
| type ServiceWorkerEvent = any; | |
| @Injectable({ | |
| providedIn: 'root' | |
| }) |
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
| //Component | |
| import { Component, Input} from '@angular/core'; | |
| @Component({ | |
| selector: 'iwdf-ui-button-spinner', | |
| template: ` | |
| <ng-container *ngIf="has; else elseTemplate"> | |
| <div class="loader">Loading...</div> | |
| </ng-container> | |
| <ng-template #elseTemplate> |
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 { NgModule } from '@angular/core'; | |
| import { Routes, RouterModule } from '@angular/router'; | |
| import { AboutusComponent } from './aboutus/aboutus.component'; | |
| import { ContactusComponent } from './contactus/contactus.component'; | |
| import { HomeComponent } from './home/home.component'; | |
| import { PortfolioComponent } from './portfolio/portfolio.component'; | |
| import { ShowcaseComponent } from './showcase/showcase.component'; | |
| const routes: Routes = [{ |
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 { Observable, BehaviorSubject } from 'rxjs'; | |
| import { distinctUntilChanged, pluck } from 'rxjs/operators'; | |
| import { Profile } from './admin/features/profile/models/profile'; | |
| export interface State { | |
| profile: Profile | |
| } |
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
| class BurgerIngredient extends Component { | |
| render () { | |
| let ingredient = null; | |
| switch ( this.props.type ) { | |
| case ( 'bread-bottom' ): | |
| ingredient = <div className={classes.BreadBottom}></div>; | |
| break; | |
| case ( 'bread-top' ): | |
| ingredient = ( |
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
| <div class="col-lg-6 px-3" [@routeState]="getAnimationData(rOutlet)" style="overflow: hidden"> | |
| <router-outlet #rOutlet="outlet"></router-outlet> | |
| </div> | |
| animations: [ | |
| trigger('routeState', [ | |
| transition('* => *', [ | |
| group([ | |
| query(':enter', [ | |
| style({ |
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 { AuthenticationNavbarComponent } from './navbar/navbar.component'; | |
| import { AuthenticationStepsComponent } from './steps/steps.component'; | |
| export const components: any[] = [ | |
| AuthenticationNavbarComponent, | |
| AuthenticationStepsComponent | |
| ]; | |
| export * from './navbar/navbar.component'; | |
| export * from './steps/steps.component'; |
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 { Observable } from 'rxjs/Observable'; | |
| import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
| import 'rxjs/add/operator/pluck'; | |
| import 'rxjs/add/operator/distinctUntilChanged'; | |
| import { User } from './auth/shared/services/auth/auth.service'; | |
| import { Meal } from './health/shared/services/meals/meals.service'; | |
| import { Workout } from './health/shared/services/workouts/workouts.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
| const data = 'username=' + encodeURIComponent(credentials.username) + '&password=' + | |
| encodeURIComponent(credentials.password) + '&grant_type=password&scope=read%20write&' + | |
| 'client_secret=' + this.clientSecret + '&client_id=' + this.clientId; | |
| const headers = new HttpHeaders() | |
| .set('Content-Type', 'application/x-www-form-urlencoded') | |
| .set('Accept', 'application/json') | |
| .set('Authorization', 'Basic ' + this.base64('myapp' + ':' + 'mySecretOAuthSecret')); | |
| return this.http.post(this.urlLogin, data, { |
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 HttpErrorHandler { | |
| static handleError(error: HttpErrorResponse) { | |
| let errorMessage = ''; | |
| if (error.error instanceof ErrorEvent) { | |
| errorMessage = error.error.message; | |
| } else { | |
| const errorMessage = `Server returned code: ${error.status}, error message is: ${error.error}`; | |
| } | |
| const msg = environment.production ? 'Something bad happened; please try again later.' : errorMessage; | |
| return throwError(msg); |