Angular Interpolation is not working properly?
up vote
2
down vote
favorite
I have one sample with interpolation. It shows drop-down values correctly when is use any one event like below:
sample: click me
code snippet:
Here i have added event (open)="onOpen()"
<ejs-dropdownlist
(open)="onOpen()"
required id="ddlApp" name="ddlApp" [dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate" [(ngModel)]="dropdownlApp"
#ddlApp="ngModel" [placeholder]='ddlAppText' [fields]='fields'>
sample 2: click me
In this sample i would not add any event, in this case interolation is not working.
Code snippet:
<ejs-dropdownlist
required id="ddlApp" name="ddlApp"
[dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate"
[(ngModel)]="dropdownlApp" #ddlApp="ngModel"
[placeholder]='ddlAppText' [fields]='fields'>
javascript angular interpolation syncfusion ng-template
add a comment |
up vote
2
down vote
favorite
I have one sample with interpolation. It shows drop-down values correctly when is use any one event like below:
sample: click me
code snippet:
Here i have added event (open)="onOpen()"
<ejs-dropdownlist
(open)="onOpen()"
required id="ddlApp" name="ddlApp" [dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate" [(ngModel)]="dropdownlApp"
#ddlApp="ngModel" [placeholder]='ddlAppText' [fields]='fields'>
sample 2: click me
In this sample i would not add any event, in this case interolation is not working.
Code snippet:
<ejs-dropdownlist
required id="ddlApp" name="ddlApp"
[dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate"
[(ngModel)]="dropdownlApp" #ddlApp="ngModel"
[placeholder]='ddlAppText' [fields]='fields'>
javascript angular interpolation syncfusion ng-template
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have one sample with interpolation. It shows drop-down values correctly when is use any one event like below:
sample: click me
code snippet:
Here i have added event (open)="onOpen()"
<ejs-dropdownlist
(open)="onOpen()"
required id="ddlApp" name="ddlApp" [dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate" [(ngModel)]="dropdownlApp"
#ddlApp="ngModel" [placeholder]='ddlAppText' [fields]='fields'>
sample 2: click me
In this sample i would not add any event, in this case interolation is not working.
Code snippet:
<ejs-dropdownlist
required id="ddlApp" name="ddlApp"
[dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate"
[(ngModel)]="dropdownlApp" #ddlApp="ngModel"
[placeholder]='ddlAppText' [fields]='fields'>
javascript angular interpolation syncfusion ng-template
I have one sample with interpolation. It shows drop-down values correctly when is use any one event like below:
sample: click me
code snippet:
Here i have added event (open)="onOpen()"
<ejs-dropdownlist
(open)="onOpen()"
required id="ddlApp" name="ddlApp" [dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate" [(ngModel)]="dropdownlApp"
#ddlApp="ngModel" [placeholder]='ddlAppText' [fields]='fields'>
sample 2: click me
In this sample i would not add any event, in this case interolation is not working.
Code snippet:
<ejs-dropdownlist
required id="ddlApp" name="ddlApp"
[dataSource]='appDataSource' [allowFiltering]='true'
[itemTemplate]="itemTemplate" [valueTemplate]="valueTemplate"
[(ngModel)]="dropdownlApp" #ddlApp="ngModel"
[placeholder]='ddlAppText' [fields]='fields'>
javascript angular interpolation syncfusion ng-template
javascript angular interpolation syncfusion ng-template
edited Nov 9 at 4:32
yurzui
91.8k10180204
91.8k10180204
asked Nov 8 at 6:30
kumaresan_sd
539
539
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
Just remove changeDetection: ChangeDetectionStrategy.OnPush
form your @Component
decorator your second sample will work
You component decorator should read as
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
Bind you object array in ngOnInit()
it is the right way to bind and right time to bind the values - Thanks, Happy coding !!
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your codechangeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you wantchangeDetection
then usechangeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties
– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.
– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Just remove changeDetection: ChangeDetectionStrategy.OnPush
form your @Component
decorator your second sample will work
You component decorator should read as
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
Bind you object array in ngOnInit()
it is the right way to bind and right time to bind the values - Thanks, Happy coding !!
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your codechangeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you wantchangeDetection
then usechangeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties
– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.
– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
|
show 1 more comment
up vote
4
down vote
accepted
Just remove changeDetection: ChangeDetectionStrategy.OnPush
form your @Component
decorator your second sample will work
You component decorator should read as
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
Bind you object array in ngOnInit()
it is the right way to bind and right time to bind the values - Thanks, Happy coding !!
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your codechangeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you wantchangeDetection
then usechangeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties
– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.
– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
|
show 1 more comment
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Just remove changeDetection: ChangeDetectionStrategy.OnPush
form your @Component
decorator your second sample will work
You component decorator should read as
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
Bind you object array in ngOnInit()
it is the right way to bind and right time to bind the values - Thanks, Happy coding !!
Just remove changeDetection: ChangeDetectionStrategy.OnPush
form your @Component
decorator your second sample will work
You component decorator should read as
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
Bind you object array in ngOnInit()
it is the right way to bind and right time to bind the values - Thanks, Happy coding !!
answered Nov 8 at 7:20
Rahul
9211314
9211314
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your codechangeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you wantchangeDetection
then usechangeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties
– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.
– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
|
show 1 more comment
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your codechangeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you wantchangeDetection
then usechangeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties
– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.
– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
Thanks for your reply.But my issue is when i use changeDetection,interpolation is not working
– kumaresan_sd
Nov 8 at 8:40
As per your code
changeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you want changeDetection
then use changeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties– Rahul
Nov 8 at 8:59
As per your code
changeDetection: ChangeDetectionStrategy.OnPush
will check only once when the component is instantiated, so that causes issue and your model is not updating after component is instantiated if you want changeDetection
then use changeDetection: ChangeDetectionStrategy.Default
this will check always when there is a change in your properties– Rahul
Nov 8 at 8:59
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
Thanks for your reply..
– kumaresan_sd
Nov 8 at 9:40
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding
(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.– yurzui
Nov 9 at 4:29
If we remove ChangeDetectionStrategy.OnPush from component then that component will be checked on any changes in any component of app. If we're working on a performant application then we should keep OnPush. Adding
(open)="0"
event should be enough to update template when we open dropdown. Angular will automatically set DropDownListComponent to be checked so that the template attached to its view will be also checked.– yurzui
Nov 9 at 4:29
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
@yurzui, i have same question. why i have to change onpush to default. if i use default it will trigger changedetection, if any changes occur but if we use onpush, it will trigger changedetection when value has been changed
– kumaresan_sd
Nov 9 at 5:06
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202531%2fangular-interpolation-is-not-working-properly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown