-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Executing "ng serve" or "npm start" command browser is not opening automatically #1081
Executing "ng serve" or "npm start" command browser is not opening automatically #1081
Comments
I don't think the intention is to open the browser automatically. When you visit the URL (http://localhost:4200) the browser should be refreshed automatically when changes occur in the code. |
We don't have this functionality at the moment, no. But I'll leave the issue open as a 'nice to have'. |
Yes, it would be nice to have this as an option. |
Thanks for response.
|
can we not use lite-server written by john papa to open the browser after ng server on inside ng serve |
There may be ambiguity between lite-server port and ng server port. |
@Trendy I would consider them 2 different features. The way i have seen the Refresh work is that you hit your site, the site has some javascript injected into it that listens for a command to tell it that something changed then it reloads the page. This is different from when you start the app sending a command to launch a browser and navigate to the URL. If you never navigated to the url of your app then there would be no code running to listen when something changed. I guess its still doable but then you would probably need a browser plugin to listen instead |
You could just change what npm start does in the package.json. E.g. change See http://stackoverflow.com/a/35261624 for Mac/Linux equivalents. Or you could use the following if you want a cross platform solution: |
Thanks On 18-Sep-2016 2:12 pm, "Chris Foster" [email protected] wrote:
|
Guys can you consider browser option? Like open in chrome or firefox. |
I like having the app launch the first time in the browser, like using browserSync with Gulp. Checked ng-cli documentation, it's #ng start -o |
This behavior should definitely be available, but through an option. |
As I mentioned, the functionality is there. There are a bunch of options on the serve command. READ THE DOCUMENTATION: |
Para que la ejecución sea automática es necesario ejecutar >ng serve -o |
The instructions say "Using the --open (or just -o) option will automatically open your browser on http://localhost:4200/.", so I'm not sure what's meant by "open", and I've never heard it to mean "refresh" (which sounds like a misnomer a non-IT person would use). Has this command ever actually opened a browser or a new tab, or opened the URL in an existing tab? What is this option actually programmed to do? |
@dhinged this command has worked for a while now, and it still seems to work as I've just tried it. I wonder why it doesn't work for you... for reference the library we use to open the browser is https://www.npmjs.com/package/opn. |
I apologize, trying it again today, it just took a while for the server to "boot up" but it did open a browser tab (after I'd opened it myself based on the instructions URL). So basically I ran the command (either time), it looked like it was running, but there was no output for maybe 15 seconds so I figured it was just running. I then later noticed a ton of output from node, so I just need to wait. However it would be nice to initially see output saying "Starting up" or something indicating it's running but still processing. Thanks for being there! |
Just go into your |
after changing from "start": "ng serve" to "start": "ng serve -o", it worked for me. |
Hi Can anyone please help me in creating a angular js application in ubuntu. |
Try debugging.
…On Tue, Feb 27, 2018 at 10:25 AM gcascbt ***@***.***> wrote:
Hi
i am unable to get any visible content display after connecting my app
with angular2 firebase. its show blank page on the browser and successfully
compiled
[image: error]
<https://user-images.githubusercontent.com/22559469/36737172-ba96e318-1bda-11e8-8add-6b398855e037.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1081 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3cJhwsDtjMMxwxKISqhcKfs-6wZyVwks5tZB57gaJpZM4I1YYs>
.
|
I'm facing the same problem. Could you resolve the issue? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Window 7
angular-cli: 0.0.39
node: 5.4.1
os: win32 x64
I have generated a project using angular-cli by following steps given in installation section. Project is running right now. But i have to open browser manually by typing http://localhost:4200/ into browser.
Could it be possible like when user will execute "ng serve" or "npm start" command, browser will open automatically?
Please let me know if it is possible or give me any solution for this.
Thanks in advance.
-Deepak
The text was updated successfully, but these errors were encountered: