AngularJS Toaster通知没有显示

时间:2015-05-11 20:47:28

标签: angularjs

单击按钮时,我有一小段代码可以打开烤面包机对话框。但是,当我点击按钮时,没有任何反应。为了简化这个问题,我删除了代码的http get部分。

(function () {

app.controller('NewScheduleController', ['$scope', '$http', 'toaster', function ($scope, $http, toaster) {
    $scope.cancelSchedule = function () {
        toaster.success({ title: "Success", body: "Cancelled successfully!" });
    }
} ]);

})();

和视图

<div class="container" ng-controller="NewScheduleController">

<div class="form-horizontal">
<div class="jumbotron">

<button ng-click="cancelSchedule()">Cancel</button>     

    </div>

</div>

<toaster-container toaster-options="{
'closeButton': false,
'debug': false,
'position-class': 'toast-top-right',
'onclick': null,
'showDuration': '200',
'hideDuration': '1000',
'timeOut': '5000',
'extendedTimeOut': '1000',
'showEasing': 'swing',
'hideEasing': 'linear',
'showMethod': 'fadeIn',
'hideMethod': 'fadeOut'
}"></toaster-container>

如果我做错了,请建议吗?也是一个angularjs新手,我想知道如何知道什么是潜在的错误?我使用chrome的inspect元素来查看控制台/网络选项卡,但没有错误。

1 个答案:

答案 0 :(得分:1)

我认为你不在剧本中包含角度动画模块

<script src="http://code.angularjs.org/1.3.3/angular-animate.min.js"></script>

看看这个羽毛球example

相关问题