<ul ng-init="names=[ {name: ‘乔乐‘, age:‘25‘}, {name: ‘周迅‘, age:‘40‘}, {name: ‘魏瑞‘, age:‘25‘}, {name: ‘展昭‘, age:‘98‘} ]"> <li ng-repeat="info in names">{{$index+1}}、今年{{info.name}}已经{{info.age}}岁了! {{$first}}-{{$middle}}-{{$last}}-{{$even}}-{{$odd}}</li> </ul>
var app = angular.module("NameApp", [‘ngAnimate‘]); app.controller("SecondCtrl", function($scope){ });
运行结果:
- 1、今年乔乐已经25岁了! true-false-false-true-false
- 2、今年周迅已经40岁了! false-true-false-false-true
- 3、今年魏瑞已经25岁了! false-true-false-true-false
- 4、今年展昭已经98岁了! false-false-true-false-true
本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/1690542
时间: 2024-10-13 17:44:20