Hi I am trying to update the view after the http service call in the
component. Disabling some controls, update some text fields, ...
*Component*
> constructor(public _PostService: PostService, public
>> _userPermissionService: UserPermissionService, public _narBLService:
>> NARBLService, private http: Http)
>
> {
>
> console.log(" Start Constructor ... disabled" + this.disabled);
>
> var digest =
>> (<HTMLInputElement>document.getElementById('__REQUESTDIGEST')).value;
>
> let header = new Headers();
>>
> header.append("Content-Type", "application/json; odata=verbose");
>
> header.append("Accept", "application/json; odata=verbose");
>
> this.http.get(this._urlMyPropsWS, { headers: header })
>
> .map(res => res.json())
>
> .subscribe(propsData => {
>
> this.http.get(this._urlGroupWS, { headers: header })
>
> .map(res => res.json())
>
> .subscribe(userGroupData => {
>
> this.http.get(this._urlListWS, { headers: header })
>
> .map(res => res.json())
>
> .subscribe(listData => {
>
> console.log("User Data ..." +
>> JSON.stringify(propsData));
>
> console.log("Group Data " +
>> JSON.stringify(userGroupData))
>
> console.log("List Data ..." +
>> JSON.stringify(listData));
>
> window.alert("Before disable ..." +
>> this.disabled);
>
> * this.disabled = false;*
>
> window.alert("Hii ... this.authData ...
>> after disabled" + this.disabled);
>
> })
>>
> })
>
> });
>
> *VIEW*
<div id="MainSection" [hidden]="mainFormAccess">
<div class="row form-inline" >
<div class="col-md-6">
<!-- Project Title -->
<label style="width: 150px"
class="control-label" for="ProjectTitle">Project Title</label>
<input style="width: 400px"*
readonly="{{disabled}}"* type="text" class="form-control" id="ProjectTitle"
name="ProjectTitle" maxlength="200" minlength="5" required alphaNumeric
[(ngModel)]="modelNAR.ProjectTitle" #ProjectTitle="ngModel" >
<div *ngIf="ProjectTitle.errors &&
(ProjectTitle.dirty || ProjectTitle.touched)">
<p *ngIf="ProjectTitle.errors.required"
class="alert alert-danger">
The Project Title is required.
</p>
<p *ngIf="ProjectTitle.errors.maxlength"
class="alert alert-danger">
The Project Title can not be more than
200 characters.
</p>
<p *ngIf="ProjectTitle.errors.minlength"
class="alert alert-danger">
The Project Title can not be less than 5
characters.
</p>
<p *ngIf="ProjectTitle.errors.alphaNumeric"
class="alert alert-danger">
Only alphabets, numbers and spaces are
allowed.
</p>
</div>
</div>
</div>
I am trying to disable the controls and later on add some text in controls
after the http web service call is completed so i can perform business
logic and make decision
Please help
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.