A TODO list app created in Angular 2
Install Node.js® and npm if they are not already on your machine
Visit : https://nodejs.org/en/download/
npm install -g @angular/cli
ng new my-application
cd my-app ng serve --open [ or ng serve -o ]
ng g service servicename
Visit : https://ng-bootstrap.github.io/#/home
npm install --save @ng-bootstrap/ng-bootstrap
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
Example :
@NgModule({
declarations: [AppComponent, ...],
imports: [NgbModule.forRoot(), ...], // forRoot is used to add application/singleton services.
bootstrap: [AppComponent]
})
export class AppModule {
}
npm install bootstrap@4.0.0-alpha.6
Example :
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
]
<div class="container">
<div class="col-xs-2">
<ul class="list-group">
<li class="list-group-item">
</li>
</ul>
</div>
</div>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<div class="container">
<div class="row">
<div class="col-sm-1">
<!-- Checkbox -->
</div>
<div class="col-sm-9">
<!-- Form -->
</div>
<div class="col-sm-1">
<!-- delete button -->
<span class="fa fa-trash-o" style="cursor:pointer;"></span>
</div>
</div>
</div>
<div class="form-group" [ngClass]="form.get('updatedTask').hasError('required') && isSubmitted ? 'has-danger' : ''">
<input type="text" class="form-control input-sm form-control-danger" id="task" placeholder="Add a task" formControlName="updatedTask" focus/>
<div class="form-control-feedback" \*ngIf="form.get('updatedTask').hasError('required') && isSubmitted">
Task name is required
</div>
</div>
<span [ngClass]="task.isDone ? 'task-done' : 'task'" (click)="enableEditing()" \*ngIf="!editable" style="cursor:pointer;" >
</span>
`npm install ng2-dnd --save`
import {BrowserModule} from "@angular/platform-browser";
import {NgModule} from '@angular/core';
import {DndModule} from 'ng2-dnd';
@NgModule({
imports: [
BrowserModule,
DndModule.forRoot()
],
bootstrap: [AppComponent]
})
export class AppModule {
}
Using bootstrap components in Angular 2 Visit: https://valor-software.com/ng2-bootstrap/#/