I am currently utilizing AngularJS to create a web application.
Within my app, I am using $routeProvider
for navigation. However, the app is quite complex, making it difficult to pinpoint the exact issue. I am curious if anyone else has encountered a similar problem specifically on Chrome for iOS:
- By initializing my MainController, I utilize "
alert
". - On browsers such as Safari, Firefox, Opera, Chrome Desktop, and Safari on iOS, the alert only pops up once, indicating that my Controller is created just once.
- However, when accessing the app on Chrome for iOS, I notice 10 to 20 alerts popping up, suggesting that the Controller is being created multiple times.
My inquiry is:
Has anyone faced a comparable situation with their own apps?
This might be a long shot, but perhaps someone else has had similar experiences and can provide insights into what could be causing this issue.
EDIT: Interestingly, when simulating iOS on Chrome (Desktop), the web app functions correctly. The problem seems specific to Chrome on iPads and iPhones.
App.config(function($routeProvider) {
$routeProvider
.when(APP_CONFIG.init_url, {
templateUrl: "views/site.html",
controller: "InitCtrl"
})
.when(APP_CONFIG.main_url, {
templateUrl: "views/site_2.html",
controller: "MainCtrl"
})
.when(APP_CONFIG.another_url, {
templateUrl: "views/site_3.html",
controller: "AnotherCtrl"
})
.when(APP_CONFIG.andanother_url, {
templateUrl: "views/site_4.html",
controller: "AndAnotherCtrl"
})
.when("/thanks", {
templateUrl: "views/site_5.html"
})
.otherwise({
templateUrl: "404.html",
controller: "NotFoundCtrl"
});
});