src/app/campaigns/campaign-name.ts
Compbaser
selector | campaign-name |
template |
|
onNext
|
$event type: EventEmitter<any>
|
Defined in src/app/campaigns/campaign-name.ts:25
|
constructor(yp: YellowPepperService)
|
Defined in src/app/campaigns/campaign-name.ts:18
|
_onKeyDown |
_onKeyDown(event: KeyboardEvent)
|
Defined in src/app/campaigns/campaign-name.ts:34
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Defined in src/app/campaigns/campaign-name.ts:40
|
Returns :
void
|
destroy |
destroy()
|
Defined in src/app/campaigns/campaign-name.ts:43
|
Returns :
void
|
Static getCampaignNameChanged |
getCampaignNameChanged: |
Defined in src/app/campaigns/campaign-name.ts:30
|
m_campaignName |
m_campaignName: |
Defined in src/app/campaigns/campaign-name.ts:28
|
import {Component, ChangeDetectionStrategy, Output, EventEmitter} from "@angular/core";
import {Compbaser} from "ng-mslib";
import {YellowPepperService} from "../../services/yellowpepper.service";
import {IUiState} from "../../store/store.data";
import {ACTION_UISTATE_UPDATE} from "../../store/actions/appdb.actions";
@Component({
selector: 'campaign-name',
// changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<small class="debug">{{me}}</small>
<h3 i18n>Select your campaign name</h3>
<input (keydown)="_onKeyDown($event)" id="newCampaignName" style="width: 50%" [(ngModel)]="m_campaignName"
type="text" class="form-control"
value="My campaign" i18n-placeholder placeholder="Enter new campaign name">
`,
})
export class CampaignName extends Compbaser {
constructor(private yp: YellowPepperService) {
super();
}
@Output()
onNext:EventEmitter<any> = new EventEmitter<any>();
m_campaignName: string = '';
public get getCampaignNameChanged(): string {
return this.m_campaignName;
}
_onKeyDown(event:KeyboardEvent){
if (event.keyCode==13){
this.onNext.emit();
}
}
ngOnInit() {
}
destroy() {
var uiState:IUiState = {
campaign: {
campaignCreateName: this.m_campaignName
}
}
this.yp.ngrxStore.dispatch(({type: ACTION_UISTATE_UPDATE, payload: uiState}))
}
}