-1

I have just started learning Ionic and Angular.

After reading basic documentation related to Angular and Ionic, I was following the tutorial from this site to develop the sample application myself.

I am able to load the application and see the data related to playlists, but after integrating 'Angular ngResource', to fetch the live data, related to sessions - by calling Rest API mentioned in the tutorial, I am not able to load the application in the browser (Blank white screen appears).

You can refer the application code with my changes here:

https://github.com/bhushanbaviskar/Angular-Ionic.git

Thanks.

Bhushan
  • 123
  • 11

1 Answers1

1

You are missing at least inclusion of the ngResource and starter.services to your app in your app.js like this:

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ngResource'])

Then in your index.html you have a lot of typos, you should replace these parts with the code below:

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- Angular ngReource-->
<script src="lib/ionic/js/angular/angular-resource.min.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>

There was ngResource <script type=""> should be src="" and also the services.js had a typo servcies.js which should be services.js. Services.js also was declared as type and need to be changed to src.

thepio
  • 6,193
  • 5
  • 35
  • 54
  • After adding this dependency as well no change in the output. – Bhushan May 23 '16 at 12:15
  • I updated my answer. With this it should work. A lot of typos and things like that in your code. – thepio May 23 '16 at 13:05
  • 1
    Thanks for pointing that out. I missed some of the dependencies and also the server URL was pointing to the wrong server. Now corrected everything and application is working fine. Thanks. – Bhushan May 24 '16 at 06:30
  • Ok, nice to hear that you got everything solved :) Glad I could help in some way at least. – thepio May 24 '16 at 06:36