试图实现与下面的错误,结果本地通知:
TypeError: Cannot read property 'notification' of undefined
有问题的代码,
function(){
$ionicPlatform.ready(function() {
$cordovaLocalNotification.add({
id: '1',
message: "Push!!"
})
}, false);
return true
}
我从离子接片例如该应用。 控制器在此调用正在发生的样子
更新
angular.module('starter.controllers', ['ionic','ngCordova']) .controller('FriendsCtrl', function($scope, $ionicPlatform, $cordovaLocalNotification,Friends) {
index.html的样子
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
<script src="js/filters.js"></script>
<script src="cordova.js"></script>
UPDATE $ ionicPlatform没有定义已定,真正的问题在于TypeError: Cannot read property 'notification' of undefined