How can I set run my angular 2 application from Intellij Idea run configuration menu?
From terminal I just put ng serve
but what should I select from list of configurations from Intellij Idea?
Select File | New | Project from the main menu or click the New Project button on the Welcome screen. In the left-hand pane, choose Angular CLI. Specify the project name and the folder to create it in. In the Node Interpreter field, specify the Node.
Now open Visual Studio Code. Go to "File" > "Open Folder" and select "First-Angular-Project" from the "Desktop". Now in the "TERMINAL" run ng new Angular-Project-Demo. Whenever it prompts with something like "Would you like to add Angular routing? (y/N)" press "y" and hit "ENTER".
One way to do it is to create a scripts entry in your package.json
, if it's not already there:
{
...
"scripts": {
"ng": "node_modules/.bin/ng",
"start": "ng serve -o -lr=false"
},
...
}
This will open the browser, and disable live-reloading (if that's what you would like.. If not, remove the -lr
option). This will also use a locally installed angular-cli
. This way you don't have to install it globally
Then create a new run configuration and choose npm
.
start
Make sure your node interpreter is set, and press ok
.
Now you can use the green button to run your configuration :)
You can also just right-click on your package.json
, and select show npm scripts
. This will open a window, where you can double click the 'start' script you just created
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With