We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Loading syncfusion scripts on page break angular routing

I made simple syncfusion-angular application with only one template and router. For routing I use angular-route library.
This is my simple router script:
(function() {
angular.module("mainApp", ["ngRoute", "ejangular"]);
angular.module("mainApp")
.config(function ($routeProvider) {
$routeProvider
.when("/events", {
templateUrl: "views/events.html",
controller: "EventsController"
.otherwise({ redirectTo: "/events" });
});
}());
Below is my main page head section where I read all my scripts.
Event Management


It is strange that my page routing does not work after manual refresh (page url breaks). I realized that problem caused scripts jsrender.min.js and ej.mobile.all.min.js, or one of them.
When I delete them from page (exclude scripts tag on page), my routing works perfectly.
Do my scripts order on page is wrong ?
Problem is described in more details on stackoverflow.
http://stackoverflow.com/questions/36211149/angular-redirect-break-page-after-manual-refresh

3 Replies

DR Dhinesh Ravi Syncfusion Team March 31, 2016 07:15 AM UTC

Hi Milos,

Thank you for contacting Syncfusion Support.

The script file ej.mobile.all.min.js is a collection of Essential Studio JavaScript Mobile components. In that, AppView acts as a base container and master page for the Mobile application. We have handled the history navigation internally for Single Page Applications, which interfere for Angular routing. Hence for Angular routing, we need to prevent the initialization of AppView. Refer to the following code example.

[html]

     <script>

        App.preventAppviewInit = true
    </script>


The above mentioned script have to be referred next to ej.mobile.all.min.js script reference.

We have created the simple sample for the requirement. Refer to the sample in the below attachment.

Sample


Note: If you are developing for web application alone, then ej.web.all.min.js is enough. No need to refer ej.mobile.all.min.js and the code example shown above.



Regards,
Dhinesh R


MI Milos March 31, 2016 07:55 AM UTC

Thank you very much for the prompt reply. It works great.
This kind of issue is a bit hard to notice, maybe would be nice that we have some warning about this in angular section.

Best Regards,
Milos


DR Dhinesh Ravi Syncfusion Team April 1, 2016 04:28 AM UTC

Hi Milos,

Thanks for the update.

We will consider your suggestion in the online documentation and it will be refreshed in online in any of our upcoming release.


Regards,
Dhinesh R

Loader.
Up arrow icon