Javascript AngularJS问题未显示输出
我使用的是Angular 1.4.8 我在控制器中有一个列表。它连接到一个模块。 在我的html中引用它不会显示活动列表 文件夹结构:app/sorting.html app/controllers/mycontroller.js }) 将输出获取为: 这里没有显示2行,而是显示所有参数的{{}Javascript AngularJS问题未显示输出,javascript,angularjs,Javascript,Angularjs,我使用的是Angular 1.4.8 我在控制器中有一个列表。它连接到一个模块。 在我的html中引用它不会显示活动列表 文件夹结构:app/sorting.html app/controllers/mycontroller.js }) 将输出获取为: 这里没有显示2行,而是显示所有参数的{{} 请帮我了解这个问题。提前谢谢 删除阵列中的坏令牌: $scope.activities = [{aname: 'First', subprocess: 'Product', activityid:
请帮我了解这个问题。提前谢谢 删除阵列中的坏令牌:
$scope.activities = [{aname: 'First', subprocess: 'Product', activityid: '500', cost: '2001'},
{aname: 'Second', subprocess: 'Program', activityid: '501', cost: '1500'},
}/*<-----remove this*/ ];
};
$scope.activities=[{aname:'First',subprocess:'Product',activityid:'500',cost:'2001'},
{aname:'Second',subprocess:'Program',activityid:'501',cost:'1500'},
}/*如果您使用的是chrome浏览器,则可以检查控制台是否存在此类错误。只需点击f12并转到“控制台”。抱歉,这是我的错误。为了简单起见,我在保留在这里时删除了一些条目。我不知道我的代码中是否有任何错误字符。对于您,新数组正在工作:或者我没有发现问题。不,它不工作。谢谢您的回答。我将尝试使用f12。可能是脚本问题。请检查控制台。可能您看到包含问题。我的数组是:$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',子流程:'Resource',activityid:'503',成本:'999'},{aname:'Fifth',子流程:'FM',activityid:'504',成本:'1765'}];
var demoApp = angular.module('demoApp', []);
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. '}}
$scope.activities = [{aname: 'First', subprocess: 'Product', activityid: '500', cost: '2001'},
{aname: 'Second', subprocess: 'Program', activityid: '501', cost: '1500'},
}/*<-----remove this*/ ];
};