AngularJS小示例<2>

<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


你可能感兴趣的:(Angular)