Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 1 | import { Component } from '@angular/core'; |
| 2 | import * as _ from 'lodash'; |
| 3 | import {DuplicateService} from "./duplicate.service"; |
| 4 | |
| 5 | @Component({ |
| 6 | selector: 'duplicate-vnf', |
| 7 | templateUrl : './duplicate-vnf.component.html', |
| 8 | styleUrls : ['./duplicate-vnf.component.scss'] |
| 9 | }) |
| 10 | export class DuplicateVnfComponent { |
| 11 | duplicateNumber : number = 1; |
| 12 | duplicateOptions : number[] = []; |
| 13 | duplicateService:DuplicateService; |
| 14 | constructor( private _duplicateService: DuplicateService ){ |
| 15 | this.duplicateService = _duplicateService; |
| 16 | this.duplicateOptions = _.range(1, this._duplicateService.maxNumberOfDuplicate + 1); |
| 17 | this.onDuplicateNumberChange(); |
| 18 | } |
| 19 | |
| 20 | onDuplicateNumberChange() { |
| 21 | this.duplicateService.setNumberOfDuplicates(+this.duplicateNumber); |
| 22 | } |
| 23 | |
| 24 | |
| 25 | } |