| 403 | } |
| 404 | |
| 405 | class TestStrategy implements NgElementStrategy { |
| 406 | connectedElement: HTMLElement | null = null; |
| 407 | disconnectCalled = false; |
| 408 | inputs = new Map<string, any>(); |
| 409 | |
| 410 | events = new Subject<NgElementStrategyEvent>(); |
| 411 | |
| 412 | connect(element: HTMLElement): void { |
| 413 | this.events.next({name: 'strategy-event', value: 'connect'}); |
| 414 | this.connectedElement = element; |
| 415 | } |
| 416 | |
| 417 | disconnect(): void { |
| 418 | this.disconnectCalled = true; |
| 419 | } |
| 420 | |
| 421 | getInputValue(propName: string): any { |
| 422 | return this.inputs.get(propName); |
| 423 | } |
| 424 | |
| 425 | setInputValue(propName: string, value: string, transform?: (value: any) => any): void { |
| 426 | this.inputs.set(propName, transform ? transform(value) : value); |
| 427 | } |
| 428 | |
| 429 | reset(): void { |
| 430 | this.connectedElement = null; |
| 431 | this.disconnectCalled = false; |
| 432 | this.inputs.clear(); |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | class TestStrategyFactory implements NgElementStrategyFactory { |
| 437 | testStrategy = new TestStrategy(); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…