1 | import { Component, OnInit } from '@angular/core';
|
2 |
|
3 | ({
|
4 | selector: 'dcs-foo',
|
5 | styleUrls: ['./foo.component.css'],
|
6 | templateUrl: './foo.component.html'
|
7 | })
|
8 | export class FooComponent implements OnInit {
|
9 | private bar: number = 42;
|
10 |
|
11 | ngOnInit() {
|
12 | console.log(this.argh);
|
13 | }
|
14 |
|
15 | get argh(): number {
|
16 | return this.bar + 5;
|
17 | }
|
18 | }
|
19 |
|
20 | export const ARGH: string = '41';
|
21 |
|
22 | export function fail() {
|
23 | throw new Error('PANIC!!!');
|
24 | }
|