import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { EffectDispatcher } from '@ck/rx';
import { IAppState } from 'app/app.state';
import { LogService } from 'app/_services';
import { ILogView } from 'app/common/logs/models';
import { SubmitAppNamesEffect } from '../actions';

@Component({
    selector: 'applicationNameSelector',
    templateUrl: 'applicationNameSelector.component.html'
})

export class ApplicationNameSelectorComponent implements OnInit {

    private _applicationNames$: Observable<string[]>;
    private _applicationNames: string[];

    private _selected: string[];
    private _subscription: Subscription;

    constructor(
        private logService: LogService,
        private effectDispatcher: EffectDispatcher,
        private store: Store<IAppState>
    ) {
        this._applicationNames$ = this.store.select(s => s.luceneParameters.appNames);
        this._subscription = this._applicationNames$.subscribe(a => this._selected = a);
    }

    onChange(_: boolean): void {
        this.effectDispatcher.dispatch(new SubmitAppNamesEffect(this._selected));
    }

    ngOnInit(): void {
        this.logService.getAllApplicationName()
            .subscribe(n => this._applicationNames = n);
     }
}
import { Component, OnInit } from '@angular/core';
import { LogService } from 'app/_services';
import { ILogView } from 'app/common/logs/models';

@Component({
    selector: 'applicationNameSelector',
    templateUrl: 'applicationNameSelector.component.html'
})

export class ApplicationNameSelectorComponent implements OnInit {

    private _applicationNames: string[];
    private _selected: string[];

    constructor(
        private logService: LogService
    ) {
    }

    onChange(_: boolean): void {
        console.log(this._selected);
    }

    ngOnInit(): void {
        this.logService.getAllApplicationName()
            .subscribe(n => this._applicationNames = n);
     }
}
--- 
+++ 
@@ -1,6 +1,12 @@
 import { Component, OnInit } from '@angular/core';
+import { Store } from '@ngrx/store';
+import { Observable } from 'rxjs/Observable';
+import { Subscription } from 'rxjs/Subscription';
+import { EffectDispatcher } from '@ck/rx';
+import { IAppState } from 'app/app.state';
 import { LogService } from 'app/_services';
 import { ILogView } from 'app/common/logs/models';
+import { SubmitAppNamesEffect } from '../actions';
 
 @Component({
     selector: 'applicationNameSelector',
@@ -9,16 +15,23 @@
 
 export class ApplicationNameSelectorComponent implements OnInit {
 
+    private _applicationNames$: Observable<string[]>;
     private _applicationNames: string[];
+
     private _selected: string[];
+    private _subscription: Subscription;
 
     constructor(
-        private logService: LogService
+        private logService: LogService,
+        private effectDispatcher: EffectDispatcher,
+        private store: Store<IAppState>
     ) {
+        this._applicationNames$ = this.store.select(s => s.luceneParameters.appNames);
+        this._subscription = this._applicationNames$.subscribe(a => this._selected = a);
     }
 
     onChange(_: boolean): void {
-        console.log(this._selected);
+        this.effectDispatcher.dispatch(new SubmitAppNamesEffect(this._selected));
     }
 
     ngOnInit(): void {
Add actions behavior for applicationNameSelector.
