Bar.ts
43 lines
| 772 B
| video/mp2t
|
TypeScriptLexer
|
|
r50 | import { Foo } from "./Foo"; | ||
|
|
r134 | /* export const service = annotate<Bar>(); | ||
|
|
r50 | |||
|
|
r127 | @service.wire({ | ||
|
|
r119 | foo: dependency("foo"), | ||
|
|
r118 | nested: { | ||
|
|
r121 | lazy: dependency("foo", { lazy: true }) | ||
| }, | ||||
|
|
r124 | host: dependency("host") | ||
|
|
r134 | }, "") */ | ||
|
|
r111 | export class Bar { | ||
|
|
r127 | barName = "Twister"; | ||
|
|
r50 | |||
|
|
r111 | _v: Foo | undefined; | ||
|
|
r134 | constructor( | ||
| _opts: { | ||||
| foo?: Foo; | ||||
| nested?: { | ||||
| lazy: () => Foo | ||||
| }, | ||||
| host: string | ||||
|
|
r121 | }, | ||
|
|
r134 | s: string | ||
| ) { | ||||
|
|
r111 | |||
|
|
r115 | if (_opts && _opts.foo) | ||
| this._v = _opts.foo; | ||||
|
|
r134 | if (s) | ||
| this.barName = s; | ||||
|
|
r50 | } | ||
|
|
r109 | |||
|
|
r125 | setName(name: string) { | ||
| } | ||||
|
|
r109 | getFoo() { | ||
|
|
r111 | if (this._v === undefined) | ||
|
|
r109 | throw new Error("The foo isn't set"); | ||
|
|
r111 | return this._v; | ||
|
|
r109 | } | ||
|
|
r50 | } | ||
