Angular needs Node.js and npm. npm is a package manager for JavaScript. It is delivered with Node.js. npm is a separate project from Node.js and updates more frequently.
Node.js is available in an LTS (long term support) version (currently v6.11.0) and in a current version with latest features (v8.1.2).
My development machine runs Linux Mint 18.1 (a distribution based on Ubuntu Xenial). I install Node.js using nvm (Node Version Manager) so that I don't have to install Node with root permission, according to nvm documentation:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
source .bashrc
nvm install node
To check installation results:
Then, I install Angular CLI, according to Angular documentation:
npm install -g @angular/cli
To check installation results:
I create the directory that will contain my first test project, generate the project and run it:
mkdir angular
cd angular
ng new my-app
cd my-app
ng serve --open
My default browser opens a new window, which displays a greeting message.
I configure my IntelliJ IDEA (Ultimate edition) according to JetBrains documentation:
Following steps are to be followed in the above test project context.
npm install bootstrap@4.0.0-alpha.6 ng-bootstrap --save
Let's add a button to the my-app project. This can be done as follows:
"../node_modules/bootstrap/dist/css/bootstrap.css"
import { FormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
ButtonsModule.forRoot(),
FormsModule
model = 1;
<div [(ngModel)]="model" ngbRadioGroup name="radioBasic">
<label class="btn btn-primary">
<input type="radio" [value]="1"> Left (pre-checked)
</label>
<label class="btn btn-primary">
<input type="radio" value="middle"> Middle
</label>
<label class="btn btn-primary">
<input type="radio" [value]="false"> Right
</label>
</div>
<hr>
<pre>{{model}}</pre>
That's it.