1

Hi I am new to angularjs framework. I am executing my app via the url localhost/angularsample, problem is when a change occurs in any file I will have to manually reload it to see the changes.

In a tutorial video I saw an angular app running on localhost:800 do live reload. How it is possible?

4
  • 1
    You need to run with Node.js to see with localhost:8000 Commented Oct 28, 2015 at 6:52
  • you need a small Node.js script, go to (youtube.com/watch?v=kHV7gOHvNdk)[this] video, it will show you how to setup a small Node.js server. It shouldn't take you much time :) Commented Oct 28, 2015 at 6:54
  • But how this is applicable in my case? Commented Oct 28, 2015 at 6:56
  • I think you need a server to make a app live, or maybe you saw tutorial where the person was coding in Brackets.io which has capability to live changes ..its just my thinking, maybe I dont understand your problem fully Commented Oct 28, 2015 at 6:59

2 Answers 2

3

It doesn't matter if you are developing with angular or react or jquery. You could bring the livereload feature with gulp or grunt or any other framework for building front-end solutions.

I would recommend to use Gulp, because it is able to watch changes in files. So, everything you need is just tell your browser to update. For this you should use watch + livereload plugin.

Take a look at this article: https://scotch.io/tutorials/a-quick-guide-to-using-livereload-with-gulp

On my projects I use gulp-connect that supports livereload as well. Take a look at this example: http://code.tutsplus.com/tutorials/gulp-as-a-development-web-server--cms-20903

Also you could research Gulp recipes: https://github.com/gulpjs/gulp/blob/master/docs/recipes/server-with-livereload-and-css-injection.md

If you need more examples try to search by key words: gulp, connect, livereload.

Sign up to request clarification or add additional context in comments.

Comments

0

[Angular] In some command line navigate to your app directory for example:

cd C:\Source\Sample\dashboard-app

Then assuming you have node.js installed and angular/cli installed do

ng serve

*I had some issue webpage not loading and it was a simple mistake which is : that when you navigate to your project you navigate to the source files not the "dist" files because if you change the dist files that will not refresh the webpage. It is important that you change the files in the src not the dist.

I hope this helps someone and save your time. Best of luck!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.