core/testing/mocks/mock-component.ts
| providers |
TestWrapperFactoryProvider
|
| selector | test-lifecycle |
| template | |
Properties |
|
Methods |
|
Inputs |
Outputs |
| something | |
Type : any
|
|
|
Defined in core/testing/mocks/mock-component.ts:34
|
|
| custom | |
Type : any
|
|
|
Inherited from
GoogleMapsComponentBase
|
|
|
Defined in
GoogleMapsComponentBase:35
|
|
| click | |
Type : EventEmitter<IGoogleMapsEventData>
|
|
|
Defined in core/testing/mocks/mock-component.ts:36
|
|
| dummyChange | |
Type : EventEmitter<IGoogleMapsEventData>
|
|
|
Defined in core/testing/mocks/mock-component.ts:37
|
|
| Protected initEmitters |
initEmitters()
|
|
Inherited from
GoogleMapsComponentBase
|
|
Executed by the constructor, before angular attempts to bind events. Calls the
Returns:
void
|
| ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
|
Inherited from
GoogleMapsComponentBase
|
||||||
|
Parameters:
Returns:
void
|
||||||
| Public Readonly NativeChangeEventName |
Type: string
|
Default value: 'dummy_change'
|
| Public Readonly NativeClickEventName |
Type: string
|
Default value: 'click'
|
| Public Readonly wrapper |
Type: TWrapper
|
Decorators:
@Inject(WrapperInstance)
|
|
Inherited from
GoogleMapsComponentBase
|
|
The instance of the wrapper to use with this component. Should be provided at the extending component level using the `WrapperInstance` token.
|
import { Component, Input, Output, EventEmitter, FactoryProvider } from '@angular/core';
import { GoogleMapsComponentBase, WrapperInstance, Hook, IGoogleMapsEventData, NativeObjectWrapper } from '@bespunky/angular-google-maps/core';
import { WrappedNativeFunctions } from '@bespunky/angular-google-maps/core';
import { MockNative } from './mock-native';
import { MockEmittingWrapper } from './mock-emitting-wrapper';
@NativeObjectWrapper<TestWrapper>()
class TestWrapper extends MockEmittingWrapper<MockNative> { }
interface TestWrapper extends WrappedNativeFunctions<MockNative> { }
export function TestWrapperFactory()
{
return new TestWrapper(new MockNative());
}
export const TestWrapperFactoryProvider: FactoryProvider = {
provide : WrapperInstance,
useFactory: TestWrapperFactory
};
// @dynamic
@Component({
selector: 'test-lifecycle',
template: '<div></div>',
providers: [TestWrapperFactoryProvider] // TODO: Move to module
})
export class MockComponent extends GoogleMapsComponentBase<TestWrapper>
{
public readonly NativeClickEventName = 'click';
public readonly NativeChangeEventName = 'dummy_change';
@Input() something: any;
@Hook() @Output() click : EventEmitter<IGoogleMapsEventData>;
@Hook('dummy_change') @Output() dummyChange: EventEmitter<IGoogleMapsEventData>;
}