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
@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(
@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 / 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',
<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>
.incentive-header {
margin: 10px;
background-color: #35404d;
color: white;
display: flex;
align-items: center;
padding: 10px 20px;
border-radius: 5px;
.incentive-title {
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']
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
{
"name": "in-home-angular",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
{
"name": "in-home-angular",
"short_name": "in-home-angular",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
@principalweb
principalweb / npm modules(Angular)
Created April 27, 2019 13:54
Angular project package.json
{
"name": "lilypadv2",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build:dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build && gzipper --verbose ./dist && node version-update.js",
"build:prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod && node version-update.js",
"test": "ng test",