Angularjs Protocol file://

Asked

Viewed 72 times

3

Guys, I’m making an embedded application in Angularjs that when the system (operating, not the application) starts, it opens the index.html that contains the application made in angular.

The front page works, but how do I send it to another page ?

I tried using routes, but how it runs in protocol file:// i don’t have a context where I can do /otherapy.

How can I display another page with another controller?

  • Your application will run on the file protocol or this is just for development?

  • It will run on file protocol.

  • I think the first problem there is to see which browser will be used, because the protocol file:// is not well standardized, each browser has its own rules for it

  • It will be run in Qtwebkit. We even had problems with CORS but we were able to configure it in qtwebkit.

  • I made it work using the good old window.location.href. The problem with that, my template doesn’t work..

1 answer

0

To work with angular you need to have an http server. However you can achieve this very simply.

1- Install node and Node package manager called npm

About the Node: https://nodejs.org/en/

Nodejs and npm installation: https://docs.npmjs.com/getting-started/installing-node

2- Create environment variable pointing to nodejs installation directory

Link to the instruction: http://udgwebdev.com/node-js-para-leigos-instalacao-e-configuracao/

3-Navigate to the directory of your files by the prompt and run the following command: http-server -a localhost -p 8000 -c-1

This command will move an http server up on port 8000. So you just open the browser and browse the files. http://localhost:8080/

NOTE: There are ways to run the file protocol. More will be a long-term problem. I recommend using this http server which is simple and powerful.

  • 1

    Dude, he said he wants to run protocol file.

  • @jbueno Yes, and what I am giving is a suggestion, because there is no way to run with the file protocol

Browser other questions tagged

You are not signed in. Login or sign up in order to post.