标签:ima led rip ase var param key fun attr
1、问题背景
AngularJS利用ng-if指令来判断对象元素是否为空
2、实现源码
<!DOCTYPE html>
<html ng-app="ifApp">
<head>
<meta charset="UTF-8">
<title>AngularJS之ng-if指令</title>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var app = angular.module("ifApp",[]);
app.controller("ifController",function($scope){
$scope.person = {
name:{
username:"张三",
sex:"男",
age:"23"
},
scores:{
item:"语文",score:"123"
}
};
});
</script>
</head>
<body ng-controller="ifController">
<div ng-if="person != null">
<div ng-repeat="p in person">
<div ng-if="person.name != null">
<label>{{p.username}}</label>
</div>
</div>
</div>
</body>
</html>
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
标签:ima led rip ase var param key fun attr
原文地址:https://www.cnblogs.com/odejsjhshw/p/10366973.html