Advertisement
Ahlushko

Untitled

Jun 15th, 2020
2,675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Injectable } from '@angular/core';
  2. import { MongoService} from 'wacom'
  3. @Injectable({
  4.     providedIn: 'root'
  5. })
  6. export class CompService {
  7.     public comp:any = []
  8.     public _comp:any = {}
  9.     constructor(
  10.         private mongo: MongoService,
  11.         ) {
  12.         this.mongo.get('comp', {}, (arr, obj) => {
  13.             this.comp = arr
  14.             this._comp = obj
  15.         })
  16.     }
  17.     create(pc) {
  18.         this.mongo.create('comp', pc)
  19.     }
  20.     delete(pc = 0) {
  21.         this.mongo.delete('comp', pc)
  22.     }
  23.     update(pc) {
  24.         this.mongo.update('comp', pc)
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement