我的角度变量不起作用:D是的它很简单,但让我解释一下......我将我的网站从角度1.2更新到角度1.4。所有角度动画都看起来很棒,它们可以工作,但角度变量没有显示。这里的代码来自angular docs。我在我的网站上尝试过,但结果是一样的..
<div ng-init="friends = [
{name:'John', age:25, gender:'boy'},
{name:'Jessie', age:30, gender:'girl'},
{name:'Johanna', age:28, gender:'girl'},
{name:'Joy', age:15, gender:'girl'},
{name:'Mary', age:28, gender:'girl'},
{name:'Peter', age:95, gender:'boy'},
{name:'Sebastian', age:50, gender:'boy'},
{name:'Erika', age:27, gender:'girl'},
{name:'Patrick', age:40, gender:'boy'},
{name:'Samantha', age:60, gender:'girl'}
]">
I have {{friends.length}} friends. They are:
<input type="search" ng-model="q" placeholder="filter friends..." aria-label="filter friends" />
<ul class="example-animate-container">
<li class="animate-repeat" ng-repeat="friend in friends | filter:q as results">
[{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
</li>
<li class="animate-repeat" ng-if="results.length == 0">
<strong>No results found...</strong>
</li>
</ul>
</div>
你怎么看?当我尝试更新我的角度版本时是否存在问题?非常感谢你
答案 0 :(得分:0)
从Angular 1.2迁移到1.4将要求您更改依赖项。有许多更改会破坏您的代码。
例如:
如需完整列表,请查看此处:https://docs.angularjs.org/guide/migration