I searched online before asking here, but couldn't find a solution.
I'm attempting to call a REST service using ngResource, but my app UI isn't launching due to an error:
05-13 02:16:08.011 2402-2402/com.app.mvalt I/chromium: [INFO:CONSOLE(25642)] "TypeError: undefined is not a function
at Object.<anonymous> (file:///android_asset/www/js/services.js:8:9)
at Object.invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17762:17)
at Object.enforcedReturnValue [as $get] (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17615:37)
at Object.invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17762:17)
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17580:37
at getService (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17721:39)
at Object.invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17753:13)
at extend.instance (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22311:34)
at nodeLinkFn (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:21421:36)
at compositeLinkFn (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:20853:13)", source: file:///android_asset/www/lib/ionic/js/ionic.bundle.js (25642)
Below is my service.js:
angular.module('app.services', ['ngResource'])
.factory('BlankFactory', [function(){
}])
.factory('User', [function($resource){
return $resource('http://1.2.3.4:1234/UASAPI/userRegistration');
}])
.service('BlankService', [function(){
}]);
Here is my index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic/js/angular-resource.min.js"></script>
<script src="cordova.js"></script>
<style type="text/css">
.platform-ios .manual-ios-statusbar-padding{
padding-top:20px;
}
.manual-remove-top-padding{
padding-top:0px;
}
.manual-remove-top-padding .scroll{
padding-top:0px !important;
}
</style>
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/routes.js"></script>
<script src="js/services.js"></script>
<script src="js/directives.js"></script>
</head>
<body ng-app="app" animation="slide-left-right-ios7">
<div>
<div>
<ion-nav-bar class="bar-stable bar-balanced">
<ion-nav-back-button class="button-icon icon ion-ios-arrow-back"></ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</div>
</div>
</body>
</html>
I downloaded angular-resource.min.js from http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.16/angular-resource.min.js
Here is my app.js:
angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'app.services', 'app.directives'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
Could someone please help me identify what I'm missing?