Skip to content

Instantly share code, notes, and snippets.

View principalweb's full-sized avatar
🏠
Working from home

Principal Angular, Ionic, React, React Native Engineer principalweb

🏠
Working from home
View GitHub Profile
import { Component, OnInit, Input, Output, EventEmitter, AfterViewInit } from '@angular/core';
import { IncentivePlan, GoalType } from '../../../../shared/models';
import * as moment from 'moment';
import { AmChartsService, AmChart } from '@amcharts/amcharts3-angular';
import { CommonService } from '../../../../shared/service';
@Component({
selector: 'app-incentive-plan',
templateUrl: './incentive-plan.component.html',
styleUrls: ['./incentive-plan.component.scss']
.incentive-header {
margin: 10px;
background-color: #35404d;
color: white;
display: flex;
align-items: center;
padding: 10px 20px;
border-radius: 5px;
.incentive-title {
<ng-container *ngIf="plan">
<div class="incentive-header">
<div class="back">
<button class="btn btn-prev btn-sm" (click)="cancelPreview()"><i class="fa fa-chevron-left"></i> BACK</button>
</div>
<div class="incentive-title">
{{ plan.title }}
</div>
<div class="date-range">
<button class="btn btn-prev btn-sm"><i class="fa fa-chevron-left"></i></button>
@principalweb
principalweb / app-routing.module.ts
Created January 30, 2019 18:18
App routing module
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from './user/auth.guard';
const routes: Routes = [
{ path: '', loadChildren: './dashboard/dashboard.module#DashboardModule', canActivate: [AuthGuard] },
{ path: 'account', loadChildren: './user/user.module#UserModule' },
{ path: 'appv2/distributor/marketrecap/:org_id/:report_id/:distributor_id',
loadChildren: './public-report/public-report.module#PublicReportModule' },
{ path: 'distributor/marketrecap/:org_id/:report_id/:distributor_id',
@principalweb
principalweb / goal.ts
Created January 30, 2019 18:17
model
export enum GoalType {
BUY = '0',
SELL = '1',
ACCOMPLISH = '2',
SELLBYUSER = '3',
ACCOMPLIAHBYUSER = '4'
}
export interface GoalValue {
name: string;
@principalweb
principalweb / http.service.ts
Created January 30, 2019 18:13
Service to consume API
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import * as lodash from 'lodash';
@Injectable()
export class HttpService {
public authFail: Boolean = false;
constructor(