How to access and display all data from list using AngularJS -
i have started learn angularjs. getting familiar of working lists. know how access , display data list. how can company name
list clients
, display in html code? , how can slug
list companylist
, display in html code?
i display list in table shown under:
1 brett software engineer apple 2 steven database administrator google
here code:
controller.js
var controllers = angular.module('myapp.controllers', []) controllers.controller('mycontroller', function ($scope) { $scope.clients = [{ name: 'brett', designation: 'software engineer', company: { name: 'apple' } }, { name: 'steven', designation: 'database administrator', company: { name: 'google' } }, { name: 'jim', designation: 'designer', company: { name: 'facebook' } }, { name: 'michael', designation: 'front-end developer', company: { name: 'apple' } }, { name: 'josh', designation: 'network engineer', company: { name: 'google' } }, { name: 'ellie', designation: 'internet marketing engineer', company: { name: 'apple' } }]; $scope.companylist = [{ name: 'apple', slug: 'apple' }, { name: 'google', slug: 'google' }, { name: 'microsoft', slug: 'microsoft' }, { name: 'facebook', slug: 'facebook' }, ]; });
and 1 question need nested list it?
<div ng-repeat="c in clients"> <tr> <td>{{$index+1}}</td> <td>{{c.name}}</td> <td>{{c.designation}}</td> <td>{{c.company.name}}</td> </tr> </div>
here requirement
Comments
Post a Comment