src/app/modules/shared/components/batch-card/batch-card.component.ts
This display a batch card
selector | app-batch-card |
styleUrls | batch-card.component.scss |
templateUrl | batch-card.component.html |
batch
|
batch is used to render Ibatch value on the view
Type: |
clickEvent
|
$event type: EventEmitter
|
constructor(resourceService: ResourceService, activatedRoute: ActivatedRoute, route: Router)
|
Constructor to create injected service(s) object
Parameters :
|
Public onAction |
onAction(batchdata: any)
|
Returns:
void
|
Public activatedRoute |
activatedRoute: |
To send activatedRoute.snapshot to router navigation |
resourceService |
resourceService: |
route |
route: |
To navigate to other pages |
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { DatePipe } from '@angular/common';
import { Ibatch } from './../../interfaces';
import { ResourceService } from '../../services/index';
/**
* This display a batch card
*/
@Component({
selector: 'app-batch-card',
templateUrl: './batch-card.component.html',
styleUrls: ['./batch-card.component.scss']
})
export class BatchCardComponent {
/**
* To navigate to other pages
*/
route: Router;
/**
* To send activatedRoute.snapshot to router navigation
* service for redirection to draft component
*/
public activatedRoute: ActivatedRoute;
/**
* batch is used to render Ibatch value on the view
*/
@Input() batch: Ibatch;
@Output() clickEvent = new EventEmitter<any>();
/**
* Constructor to create injected service(s) object
* Default method of batch card Component class
*@param {WorkSpaceService} WorkSpaceService Reference of WorkSpaceService
*@param {BatchService} BatchService Reference of WorkSpaceService
* @param {Router} route Reference of Router
* @param {ActivatedRoute} activatedRoute Reference of ActivatedRoute
*/
constructor(public resourceService: ResourceService,
activatedRoute: ActivatedRoute,
route: Router) {
this.route = route;
this.activatedRoute = activatedRoute;
}
public onAction(batchdata) {
this.clickEvent.emit({ 'action': 'batchcardclick', 'data': batchdata });
}
}