我最近开始使用 AngularJS 和 Lumx。我尝试添加可以在网站的“通知”选项卡下找到的通知。链接在这里。
任何人,我得到的错误是
“错误:未定义 LxNotificationService”
所以我将它添加到控制器中的服务列表中。
下面是我的 app.js 文件
var testing = angular.module('testing', []);
testing.controller('mainCtrl', function ($scope){
$scope.notify = function(type)
{
if (type === 'simple')
{
LxNotificationService.notify('Lorem Ipsum');
}
else if (type === 'sticky')
{
LxNotificationService.notify('Lorem Ipsum', undefined, true);
}
else if (type === 'icon')
{
LxNotificationService.notify('Lorem Ipsum', 'android');
}
else if (type === 'color')
{
LxNotificationService.notify('Lorem Ipsum', undefined, false, 'grey');
}
else if (type === 'info')
{
LxNotificationService.info('Lorem Ipsum');
}
else if (type === 'success')
{
LxNotificationService.success('Lorem Ipsum');
}
else if (type === 'warning')
{
LxNotificationService.warning('Lorem Ipsum');
}
else if (type === 'error')
{
LxNotificationService.error('Lorem Ipsum');
}
};
});
html 页面上的所有内容都运行良好,我认为我只是没有正确调用该服务。有人可以帮忙吗?
附言
下面是我所有的脚本文件的列表。
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/velocity/velocity.js"></script>
<script src="bower_components/moment/min/moment-with-locales.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/lumx/dist/lumx.min.js"></script>
<script src="app.js"></script>
提前谢谢你,尼尔