Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit, Input } from "@angular/core";
- import { FirstClass } from "~/shared/firstclass.model";
- import { SecondClass } from "~/shared/secondclass.model";
- import { DataService } from "~/shared/data.service";
- @Component({
- selector: "test-component",
- moduleId: module.id,
- templateUrl: "./test.component.html",
- styleUrls: ['./test.component.css']
- })
- export class TestComponent implements OnInit {
- tickettypes: TicketType[];
- @Input("first")
- public get first() {
- return this._first;
- };
- public set first(value: FirstClass) {
- this._first = value;
- }
- private _first: FirstClass;
- @Input("second")
- public get second() {
- return this._second;
- };
- public set second(value: SecondClass) {
- this._second = value;
- }
- private _second: SecondClass;
- constructor(
- private dataService: DataService
- ) {
- // Use the component constructor to inject providers.
- }
- ngOnInit(): void {
- }
- itemTap(tickettype: TicketType) {
- let item = new SecondClass( {
- foo: "bar"
- });
- this.dataService.addItem(item);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment