angularjs - 非空白 ng-app 名称停止表达式被评估
问题描述
为什么会ng-app="myApp"
导致表达式不计算?
如果我使用ng-app=""
,它工作正常:
<!DOCTYPE html>
<html>
<head>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="" ng-init="quantity=2;price=5">
<h2>Cost Calculator</h2>
Quantity: <input type="number" ng-model="quantity">
Price: <input type="number" ng-model="price">
<p><b>Total in dollar:</b> {{quantity * price}}</p>
</div>
</body>
</html>
解决方案
推荐阅读
- google-apps-script - Using authorization token from G Suite add-on for use on my api service
- c - can't figure out the sizeof(long double) in C is 16 bytes or 10 bytes
- amazon-web-services - S3 GetObjectTagging error for only subset of similar files
- android - Android FastAdapter ClickEventHook isn't working properly
- c# - HTTP Error 500.0 - ANCM In-Process Handler Load Failure
- r - R重新排列数据框尺寸
- javascript - VueJS - is there a way to force a mixin reload?
- android-fragments - Overlapping of fragments when transiting on clicking on an item in RecyclerView of one fragment to another new fragment
- python - How to calculate x*x.T in python
- python - pandas matrix calculation till the diagonal