Angular ng-repeat doesn't work, but I'm able to display array elements individually [duplicate]












0















This question already has an answer here:




  • Angular 4 Data Binding over ng-repeat

    1 answer




PROBLEM: I'm not able to see any of the string array elements I'm trying to print using ng-repeat.



COMPONENT:



import { 
Component
} from '@angular/core';

@Component ({
selector: 'my-app',
templateUrl: 'app/app.component.html'
})

export class AppComponent {
TutorialName: string = 'Angular JS2';
appList: string = ["Binding", "Display", "Services"];
currentTime = new Date();
}


TEMPLATE:



  <div> 
The first item is {{appList[0] }}<br>
The first item is {{appList[0] | lowercase}} (lowercase)<br>
The first item is {{appList[0] | uppercase}} (uppercase)<br>
The second item is {{appList[1] }}<br>
The items are:
<ol>
<li ng-repeat="a in appList">{{a}}</li>
</ol>
The date/time is: {{currentTime}}<br>
The date/time is: {{currentTime | date:'MM/dd/yyyy'}} (date:'MM/dd/yyyy')<br>
</div>


Everything displays find except {{a}}.



Q: What is the correct way to access string array "appData" so the items print correctly with "ng-repeat"?



ANGULAR VERSION:



Angular CLI: 7.0.5
Node: 11.1.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.5
@angular-devkit/core 7.0.5
@angular-devkit/schematics 7.0.5
@schematics/angular 7.0.5
@schematics/update 0.10.5
rxjs 6.3.3
typescript 3.1.6









share|improve this question













marked as duplicate by Sajeetharan angular
Users with the  angular badge can single-handedly close angular questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 12 at 3:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 2




    Try <li *ngFor="a of appList">{{a}}</li>.
    – ConnorsFan
    Nov 12 at 3:12
















0















This question already has an answer here:




  • Angular 4 Data Binding over ng-repeat

    1 answer




PROBLEM: I'm not able to see any of the string array elements I'm trying to print using ng-repeat.



COMPONENT:



import { 
Component
} from '@angular/core';

@Component ({
selector: 'my-app',
templateUrl: 'app/app.component.html'
})

export class AppComponent {
TutorialName: string = 'Angular JS2';
appList: string = ["Binding", "Display", "Services"];
currentTime = new Date();
}


TEMPLATE:



  <div> 
The first item is {{appList[0] }}<br>
The first item is {{appList[0] | lowercase}} (lowercase)<br>
The first item is {{appList[0] | uppercase}} (uppercase)<br>
The second item is {{appList[1] }}<br>
The items are:
<ol>
<li ng-repeat="a in appList">{{a}}</li>
</ol>
The date/time is: {{currentTime}}<br>
The date/time is: {{currentTime | date:'MM/dd/yyyy'}} (date:'MM/dd/yyyy')<br>
</div>


Everything displays find except {{a}}.



Q: What is the correct way to access string array "appData" so the items print correctly with "ng-repeat"?



ANGULAR VERSION:



Angular CLI: 7.0.5
Node: 11.1.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.5
@angular-devkit/core 7.0.5
@angular-devkit/schematics 7.0.5
@schematics/angular 7.0.5
@schematics/update 0.10.5
rxjs 6.3.3
typescript 3.1.6









share|improve this question













marked as duplicate by Sajeetharan angular
Users with the  angular badge can single-handedly close angular questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 12 at 3:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 2




    Try <li *ngFor="a of appList">{{a}}</li>.
    – ConnorsFan
    Nov 12 at 3:12














0












0








0








This question already has an answer here:




  • Angular 4 Data Binding over ng-repeat

    1 answer




PROBLEM: I'm not able to see any of the string array elements I'm trying to print using ng-repeat.



COMPONENT:



import { 
Component
} from '@angular/core';

@Component ({
selector: 'my-app',
templateUrl: 'app/app.component.html'
})

export class AppComponent {
TutorialName: string = 'Angular JS2';
appList: string = ["Binding", "Display", "Services"];
currentTime = new Date();
}


TEMPLATE:



  <div> 
The first item is {{appList[0] }}<br>
The first item is {{appList[0] | lowercase}} (lowercase)<br>
The first item is {{appList[0] | uppercase}} (uppercase)<br>
The second item is {{appList[1] }}<br>
The items are:
<ol>
<li ng-repeat="a in appList">{{a}}</li>
</ol>
The date/time is: {{currentTime}}<br>
The date/time is: {{currentTime | date:'MM/dd/yyyy'}} (date:'MM/dd/yyyy')<br>
</div>


Everything displays find except {{a}}.



Q: What is the correct way to access string array "appData" so the items print correctly with "ng-repeat"?



ANGULAR VERSION:



Angular CLI: 7.0.5
Node: 11.1.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.5
@angular-devkit/core 7.0.5
@angular-devkit/schematics 7.0.5
@schematics/angular 7.0.5
@schematics/update 0.10.5
rxjs 6.3.3
typescript 3.1.6









share|improve this question














This question already has an answer here:




  • Angular 4 Data Binding over ng-repeat

    1 answer




PROBLEM: I'm not able to see any of the string array elements I'm trying to print using ng-repeat.



COMPONENT:



import { 
Component
} from '@angular/core';

@Component ({
selector: 'my-app',
templateUrl: 'app/app.component.html'
})

export class AppComponent {
TutorialName: string = 'Angular JS2';
appList: string = ["Binding", "Display", "Services"];
currentTime = new Date();
}


TEMPLATE:



  <div> 
The first item is {{appList[0] }}<br>
The first item is {{appList[0] | lowercase}} (lowercase)<br>
The first item is {{appList[0] | uppercase}} (uppercase)<br>
The second item is {{appList[1] }}<br>
The items are:
<ol>
<li ng-repeat="a in appList">{{a}}</li>
</ol>
The date/time is: {{currentTime}}<br>
The date/time is: {{currentTime | date:'MM/dd/yyyy'}} (date:'MM/dd/yyyy')<br>
</div>


Everything displays find except {{a}}.



Q: What is the correct way to access string array "appData" so the items print correctly with "ng-repeat"?



ANGULAR VERSION:



Angular CLI: 7.0.5
Node: 11.1.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.5
@angular-devkit/core 7.0.5
@angular-devkit/schematics 7.0.5
@schematics/angular 7.0.5
@schematics/update 0.10.5
rxjs 6.3.3
typescript 3.1.6




This question already has an answer here:




  • Angular 4 Data Binding over ng-repeat

    1 answer








angular angularjs-ng-repeat






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 3:09









paulsm4

76.8k999126




76.8k999126




marked as duplicate by Sajeetharan angular
Users with the  angular badge can single-handedly close angular questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 12 at 3:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Sajeetharan angular
Users with the  angular badge can single-handedly close angular questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 12 at 3:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2




    Try <li *ngFor="a of appList">{{a}}</li>.
    – ConnorsFan
    Nov 12 at 3:12














  • 2




    Try <li *ngFor="a of appList">{{a}}</li>.
    – ConnorsFan
    Nov 12 at 3:12








2




2




Try <li *ngFor="a of appList">{{a}}</li>.
– ConnorsFan
Nov 12 at 3:12




Try <li *ngFor="a of appList">{{a}}</li>.
– ConnorsFan
Nov 12 at 3:12












1 Answer
1






active

oldest

votes


















4














Angular no longer uses ng-repeat, that was updated when Angular moved from AngularJS to just Angular Angular 1.X --> Angular 2+



use *ngFor instead used the same way like so...



 <ol>
<li *ngFor="let a of appList">{{a}}</li>
</ol>


you can read about the change from ng-repeat to *ngFor here






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    Angular no longer uses ng-repeat, that was updated when Angular moved from AngularJS to just Angular Angular 1.X --> Angular 2+



    use *ngFor instead used the same way like so...



     <ol>
    <li *ngFor="let a of appList">{{a}}</li>
    </ol>


    you can read about the change from ng-repeat to *ngFor here






    share|improve this answer




























      4














      Angular no longer uses ng-repeat, that was updated when Angular moved from AngularJS to just Angular Angular 1.X --> Angular 2+



      use *ngFor instead used the same way like so...



       <ol>
      <li *ngFor="let a of appList">{{a}}</li>
      </ol>


      you can read about the change from ng-repeat to *ngFor here






      share|improve this answer


























        4












        4








        4






        Angular no longer uses ng-repeat, that was updated when Angular moved from AngularJS to just Angular Angular 1.X --> Angular 2+



        use *ngFor instead used the same way like so...



         <ol>
        <li *ngFor="let a of appList">{{a}}</li>
        </ol>


        you can read about the change from ng-repeat to *ngFor here






        share|improve this answer














        Angular no longer uses ng-repeat, that was updated when Angular moved from AngularJS to just Angular Angular 1.X --> Angular 2+



        use *ngFor instead used the same way like so...



         <ol>
        <li *ngFor="let a of appList">{{a}}</li>
        </ol>


        you can read about the change from ng-repeat to *ngFor here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 12 at 3:18

























        answered Nov 12 at 3:12









        Smokey Dawson

        1,795939




        1,795939















            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values