【发布时间】:2016-02-29 11:38:38
【问题描述】:
我在我的项目中使用流星、角度和离子。当按下模态中的某个按钮时,我想增加一个计数器。然后我想显示这个计数器的值。 我的代码如下,但它似乎根本不起作用:
HTML
<button class="button button-clear button-positive" ng-click="timee(1)">
Delay
</button>
控制器
angular
.module('Buschat')
.controller('NewGoodCtrl', NewGoodCtrl);
function NewGoodCtrl($scope, $state, $meteor) {
$scope.timecnt=0;
$scope.hideModal = hideModal;
$scope.timee = timee;
function hideModal() {
$scope.modal.hide();
}
function timee(inc){
$scope.timecnt += inc;
$scope.modal.hide();
}
顺便提一下,当$scope.timecnt += inc; 行被删除时,隐藏模式功能完美运行
【问题讨论】:
标签: javascript angularjs meteor counter increment