Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ................................................................................................................
- TypeScript
- ................................................................................................................
- ngOnInit() {
- this.userService.getAllUser()
- .subscribe(
- data => {
- for (var item of data) {
- this.options.push({ id: item._id, nama: item.nama });
- }
- },
- error => console.error(error)
- );
- this.route.params.subscribe(params => {
- this.userService.getUserById(params.id)
- .subscribe(
- (tempUser) => {
- console.log(tempUser);
- this.user = tempUser;
- this.dataForm._id = tempUser._id;
- this.dataForm.umat = tempUser.umat;
- this.dataForm.username = tempUser.username;
- this.dataForm.password = tempUser.password;
- this.dataForm.notifikasi_email = tempUser.notifikasi_email;
- this.dataForm.notifikasi_push = tempUser.notifikasi_push;
- });
- });
- };
- ................................................................................................................
- HTML
- ................................................................................................................
- <div class="form-group m-form__group row">
- <label class="col-form-label col-lg-3 col-sm-12">
- Username *
- </label>
- <div class="col-lg-4 col-md-9 col-sm-12">
- <input type="text" class="form-control m-input" name="name" [(ngModel)]="dataForm.username" placeholder="Masukan Username anda."
- data-toggle="m-tooltip" title="Masukkan Username anda" disabled>
- <input type="hidden" class="form-control m-input" name="_id" [(ngModel)]="dataForm._id" [ngModelOptions]="{standalone: true}">
- </div>
- </div>
- <div class="form-group m-form__group row">
- <label class="col-form-label col-lg-3 col-sm-12">
- password *
- </label>
- <div class="col-lg-4 col-md-9 col-sm-12">
- <input type="text" class="form-control m-input" name="password" [(ngModel)]="dataForm.password" placeholder="Masukan password anda."
- data-toggle="m-tooltip" title="Masukkan password anda" disabled>
- </div>
- </div>
- <div class="form-group m-form__group row">
- <label class="col-form-label col-lg-3 col-sm-12">
- Notifikasi Push
- </label>
- <div class="col-lg-4 col-md-9 col-sm-12">
- <div class="m-checkbox-list">
- <label class="m-checkbox m-checkbox--state-primary">
- <input type="checkbox" [(ngModel)]="dataForm.notifikasi_email" value="true" [ngModelOptions]="{standalone: true}" disabled>
- <span></span>
- </label>
- </div>
- </div>
- </div>
- <div class="form-group m-form__group row">
- <label class="col-form-label col-lg-3 col-sm-12">
- Notifikasi Email
- </label>
- <div class="col-lg-4 col-md-9 col-sm-12">
- <div class="m-checkbox-list">
- <label class="m-checkbox m-checkbox--state-primary">
- <input type="checkbox" [(ngModel)]="dataForm.notifikasi_push" value="true" [ngModelOptions]="{standalone: true}" disabled>
- <span></span>
- </label>
- </div>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement