Ionic Framework - loading Ionic View into the application, not getting the latest javascript files, maybe there is a cache?

I myself study the Ionic framework, I downloaded the ionic start myApp tabs according to the start page from the Ionic framework ( http://ionicframework.com/getting-started/ )

Everything is fine, it works and works on my mac, it can serve and imitate. Now ... when I used ionic upload for the Ionic View application on my mobile device, that's all as expected.

BUT, when I changed something, for example, in the controller.js file:

 .controller('AccountCtrl', function($scope) { $scope.settings = { enableFriends: true }; }); 

to enableFriends:false

and I am ionic upload , then I am 'sync to latest' in the Ionic View application on my iphone ... I still get enableFriends: true (because the option was set to true - the switch is green)

  • To tell you, I have ionic build ios before ionic upload , I tried to uninstall the application in the Ionic View application on my phone and re-download it.

So I suspect that controllers.js is cached ... if so .. how can I clear this cache ?? !!!

+6
source share
3 answers

I just found a solution, but not sure if it is correct, but it works!

in ionic.project ...

 { "name": "someProject", "app_id": "2312n33" } 

remove app_id !!!!

 { "name": "someProject", "app_id": "" } 

this will create a new application and it will work! However, if there is a better way to do this, like clearing the cache (maybe this is the right way) - write.

UPDATE - May 20, 2015

The Ionic View app simply fixed a caching issue in which synchronization changes did not show up - in version 1.0.6. Therefore, this should no longer be a problem.

+3
source

For those who can view this, which may have problems with this in Ionic V2 applications that are not updated in the Ionic View application, the execution process:

  • ion feed
  • ion loading
  • delete application data in an application of the form

You will notice that when you start the ion service, a build process is in progress that will update your files. Then you download and your changes will be there. Hope this helps someone in the future.

+5
source

Have you learned this more?

try using $ ionicConfigProvider and set the cache to 0

The line of code will look like this:

 angular.module('myApp' ['ionic', 'starter.controllers', 'starter.services']) .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) { $ionicConfigProvider.views.maxCache(0); //the rest of your Router information below here }); 

here is a link to the API where I found it

This may not be the best way, but this is another option.

0
source

Source: https://habr.com/ru/post/985951/


All Articles