AngularJS问题未显示输出
AngularJS issue not showing output
我使用的是Angular 1.4.8我在控制器里有一个列表。它连接到一个模块。在我的html中引用它不会显示活动列表
文件夹结构:app/sorting.html
<!Doctype html>
<html ng-app="demoApp">
<body ng-controller="MyC">
<div>
Filter it on: <input type="text" ng-model="filteron.aname" />
<table>
<TR>
<TD>Activity Id </TD>
<TD> Sbprocess Name </TD>
<TD> Activity Name </TD>
<TD> Cost </TD>
</TR>
<TR ng-repeat="activity in activities | filter:filteron">
<TD>{{activity.activityid}}</TD>
<TD>{{activity.aname}}</TD>
<TD>{{activity.subprocess}}</TD>
<TD>{{activity.cost | currency:'Rs. '}}</TD>
</TR>
</table>
</div>
<script src="angular.js"></script>
<script src="controllers/app.js"></script>
<script src="controllers/mycontroller.js"></script>
</body>
</html>
app/controllers/app.js
var demoApp = angular.module('demoApp', []);
app/controllers/mycontroller.js
var MyC = function ($scope) {
$scope.activities = [{aname: 'First', subprocess: 'Product', activityid: '500', cost: '2001'},
{aname: 'Second', subprocess: 'Program', activityid: '501', cost: '1500'},
{aname: 'Third', subprocess: 'Engineeding', activityid: '502', cost: '5999'},
{aname: 'Fourth', subprocess: 'Resource', activityid: '503', cost: '999'},
{aname: 'Fifth', subprocess: 'FM', activityid: '504', cost: '1765'}];
};
angular.module('demoApp')
.controller('MyC', MyC);
正在将输出作为:
Filter it on: textbox shows here.
Activity Id Sbprocess Name Activity Name Cost
{{activity.activityid}} {{activity.aname}} {{activity.subprocess}} {{activity.cost | currency:'Rs. '}}
在这里,它没有显示2行,而是显示为所有参数的{{}}。
请帮我知道这个问题。提前感谢!!
删除数组中的坏标记:
$scope.activities = [{aname: 'First', subprocess: 'Product', activityid: '500', cost: '2001'},
{aname: 'Second', subprocess: 'Program', activityid: '501', cost: '1500'},
}/*<-----remove this*/ ];
};
Codepen工作:http://codepen.io/armellajuan/pen/admKOv
相关文章:
- 如何在页面一侧的浮动框中显示用户脚本的输出
- 输出文本不't以正确格式显示
- 为什么我的Alexa技能测试显示正确的lambda输出,但在开发人员控制台中测试时却给出错误消息
- 如何在文本框中显示内部 HTML 输出
- 从一个文本框执行代码,并在另一个文本框中以 HTML 显示输出
- 将咖啡转换为javascript,并将结果显示在Emacs中的标准输出中
- 如何使用innerHTML显示多个输出
- 在命令运行时以Grunt显示输出
- TypeAhead.js没有显示任何输出Rails
- 让我的javascript输出显示在HTML中
- Javascript/JSON输出不;t显示
- 读取本地文件并将请求的输出显示到 html 文件
- 如何将执行输出显示到文本区域中
- 如何使多个JavaScript函数的输出显示在HTML中
- JS测试输出显示在控制台中,而它应该'不要使用Chrome和IE
- Json输出显示打印漂亮
- PHP图像标题输出显示
- 如何用JS输出显示在外部网页上的值
- 我的输出显示“;[对象HTMLInputElement]”;而不是我输入的总和
- AJAX PHP输出显示不正确