diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts
index a7d951b1a..cb7d5230c 100755
--- a/ng6-seed/src/app/app.module.ts
+++ b/ng6-seed/src/app/app.module.ts
@@ -67,6 +67,8 @@ import { ReqTokenInterceptor } from './_guard/req-token.interceptor';
import { DynamicNotifyComponent } from './layouts/dynamic-notify/dynamic-notify.component';
// import { SelectAllComponent } from './select-all/select-all.component';
// import { CustomNotificationComponent } from './layouts/custom-notification/custom-notification.component';
+//import { SelectAllComponent } from './select-all/select-all.component';
+//import { CustomNotificationComponent } from './layouts/custom-notification/custom-notification.component';
//import { OtpComponent } from './session/otp/otp.component';
diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts
index b5b1a8009..e80efab99 100755
--- a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts
+++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts
@@ -22,6 +22,7 @@ import { MatDialog } from '@angular/material';
import { PushNotifyService } from 'app/shared/push-notify.service';
import { DynamicNotifyComponent } from '../dynamic-notify/dynamic-notify.component';
+//import { CustomNotificationComponent } from '../custom-notification/custom-notification.component';
diff --git a/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.html b/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.html
index 0d42a0c57..08c4cfd4a 100644
--- a/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.html
+++ b/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.html
@@ -43,13 +43,16 @@
Select All
{{option.first_name}}
+
+
+
+
-
-
+
diff --git a/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.ts b/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.ts
index 665af8f6d..6231590b7 100644
--- a/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.ts
+++ b/ng6-seed/src/app/layouts/dynamic-notify/dynamic-notify.component.ts
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
-import { FormBuilder, FormGroup } from '@angular/forms';
+import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { MatOption } from '@angular/material';
import { UserService } from 'app/settings/service/user.service';
@@ -12,8 +12,8 @@ import { UserService } from 'app/settings/service/user.service';
})
export class DynamicNotifyComponent implements OnInit {
selectedAll:any={pdofficer:false}
- pdofficer: any;
- msg: any;
+ // pdofficer: any;
+ // msg: any;
pdofficerlist: any = [];
selectedItems:any=[];
dropdownSettings:any={};
@@ -21,6 +21,9 @@ export class DynamicNotifyComponent implements OnInit {
customnotifyform: FormGroup;
@ViewChild('allSelected') private allSelected: MatOption;
+ pdofficer = new FormControl("", [Validators.required]);
+ msg = new FormControl("", [Validators.required]);
+
constructor( public users:UserService,private _fb:FormBuilder) {
@@ -29,8 +32,11 @@ export class DynamicNotifyComponent implements OnInit {
ngOnInit() {
this.customnotifyform = this._fb.group({
- pdofficer:[''],
- msg:[''],
+ // pdofficer:[''],
+ // msg:[''],
+ pdofficer: this.pdofficer,
+ msg: this.msg
+
})
this.getPdofficersList()
@@ -103,10 +109,10 @@ toggleAllSelection() {
onSubmitUserDetails(param) {
console.log(param)
let configdata;
- param.pdofficer.shift()
+ // param.pdofficer.shift()
console.log(param.pdofficer.length -1 + ' '+ this.pdofficerlist.length)
- if ((param.pdofficer.length) == this.pdofficerlist.length){
- configdata = { "records":{ "user_id":0,"msg":param.msg} }
+ if ((param.pdofficer.length - 1) == this.pdofficerlist.length){
+ configdata = { "records":{ "user_id":[0],"msg":param.msg} }
}
else{
configdata = { "records":{ "user_id":param.pdofficer,"msg":param.msg} }
@@ -122,7 +128,9 @@ toggleAllSelection() {
}
-
+ public hasError = (controlName: string, errorName: string) => {
+ return this.customnotifyform.controls[controlName].hasError(errorName);
+ };
}