Use the direct Angular routes of the HTML file

6

I need to develop an offline app where it will be accessed directly from the HTML file, as far as I know Angular needs the HTTP protocol to perform the routes yet.

Eg: The URL will thus be file://angular-project/index.html/#/lista instead of http://localhost/angular-project/#/lista

I need it to work with file://

    
asked by anonymous 06.04.2015 / 19:01

1 answer

2

Your offline application can make use of Application Cache.

Basically, you will need to create a manifest file containing a mention of all the files you want to offer offline.

When requested, the browser will try to load the Application cache files first, only to attempt to establish an HTTP connection with the server.

(If new versions of at least one of the files are available, you can then try to reload the application.)

This mechanism is compatible with Routes and States of AngularJS.

References for consultation:

link
link

    
06.04.2015 / 21:29