Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit, VERSION, ViewEncapsulation } from '@angular/core';
- import { HttpErrorResponse } from '@angular/common/http';
- import { routerTransition } from '../../router.animations';
- import { QueToDesignService } from './que-to-design.service';
- @Component({
- selector : 'app-design',
- templateUrl : './que-to-design.component.html',
- styleUrls : ['./que-to-design.component.scss'],
- animations : [ routerTransition() ],
- providers : [ QueToDesignService ],
- encapsulation : ViewEncapsulation.None
- })
- export class QueToDesignComponent implements OnInit {
- // Init Variables
- newSales : any;
- newSalesTime : any;
- nodes = [
- {
- id: 1,
- name: '3 Units',
- children: [
- { id: 2, name: 'HGR 234 GP' },
- { id: 3, name: 'CA 987 - 896' },
- { id: 4, name: 'ND 987 - 123' }
- ],
- className: 'root1Class',
- },
- ];
- options = {
- allowDrag: true,
- animateSpeed: 30,
- animateAcceleration: 1.2
- };
- constructor( private service: QueToDesignService) {
- }
- ngOnInit() {
- this.service.getSalesData()
- .subscribe(
- data => {
- this.newSales = data.obj;
- },
- (err: HttpErrorResponse) => {
- if (err.error instanceof Error) {
- console.log('An error occurred:', err.error.message);
- } else {
- console.log(`Backend returned code ${err.status}, body was: ${err.error}`);
- console.log( JSON.stringify( err.error ) );
- }
- }
- );
- }
- configureJob(){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement