Saturday, June 27, 2015

AngularJS Expressions using Arrays

In the previous posts we saw AngularJS expressions with string, numbers and Objects, in this post we shall see on how to use AngularJS expressions involving arrays.

AngularJS Expressions using String and Numbers

AngularJS Expressions using Objects

This comes in handy when we want to display a list of values, especially while using MVC pattern if we want to display a list/table of values we can get them in an array and use the array in ng-repeat to iterate through each element in the array.

In the following example we shall see on how to use arrays and display the content of the arrays using expressions in the view.

<html ng-app>
    <meta charset="utf-8" />
    <title>AngularJS - Basic</title>
    <script src="angular.min.js"></script>
          <div ng-init="Employees=[
                       <li ng-repeat="emp in Employees">
                         {{ }} - {{ emp.Name }}<br/>


Search Flipkart Products:

No comments: