@@ -39,20 +39,24 @@ Visit : https://nodejs.org/en/download/
39
39
40
40
## 4) Once installed you need to import our main module
41
41
42
- ` import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; `
42
+ ``` typescript
43
+ import {NgbModule } from ' @ng-bootstrap/ng-bootstrap' ;
44
+ ```
43
45
44
46
## 5) Need to add imports in AppModule
45
47
46
48
Example :
47
49
48
- `@NgModule({
50
+ ``` typescript
51
+ @NgModule ({
49
52
declarations: [AppComponent , ... ],
50
53
imports: [NgbModule .forRoot (), ... ], // forRoot is used to add application/singleton services.
51
54
bootstrap: [AppComponent ]
52
55
})
53
56
54
57
export class AppModule {
55
- }`
58
+ }
59
+ ```
56
60
57
61
## 6) Install bootstrap (Using only for CSS reference)
58
62
@@ -62,26 +66,31 @@ Visit : https://nodejs.org/en/download/
62
66
63
67
Example :
64
68
65
- `"styles": [
69
+ ``` css
70
+ "styles": [
66
71
" styles.css" ,
67
72
" ../node_modules/bootstrap/dist/css/bootstrap.css"
68
- ] `
73
+ ]
74
+ ```
69
75
70
76
71
77
# TODO COMPONENT TEMPLATE
72
78
73
- `<div class =" container " >
79
+ ```html
80
+ <div class="container">
74
81
<div class="col-xs-2 ">
75
82
<ul class="list-group ">
76
83
<li class="list-group-item ">
77
84
</li >
78
85
</ul >
79
86
</div >
80
- </div >`
87
+ </div >
88
+ ```
81
89
82
90
# TASK COMPONENT TEMPLATE
83
91
84
- `<link rel =" stylesheet " href =" https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css " >
92
+ ```html
93
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn .com/font-awesome /4.5 .0/css/font-awesome .min .css">
85
94
<div class="container">
86
95
<div class="row">
87
96
<div class="col-sm-1 ">
@@ -95,30 +104,36 @@ Visit : https://nodejs.org/en/download/
95
104
<span class="fa fa-trash-o " style="cursor :pointer;"> </span >
96
105
</div >
97
106
</div >
98
- </div >`
107
+ </div >
108
+ ```
99
109
100
110
# FORM Validation css
101
111
102
- `<div class="form-group" [ ngClass] ="form.get('updatedTask').hasError('required') && isSubmitted ? 'has-danger' : ''">
112
+ ```html
113
+ <div class="form-group " [ngClass ]="form .get('updatedTask').hasError('required ') && isSubmitted ? 'has-danger ' : ''">
103
114
<input type="text" class="form-control input-sm form-control-danger " id="task" placeholder="Add a task" formControlName="updatedTask" focus/>
104
115
<div class="form-control-feedback " \* ngIf="form .get('updatedTask').hasError('required ') && isSubmitted">
105
116
Task name is required
106
117
</div >
107
- </div >`
118
+ </div >
119
+ ```
108
120
109
121
# STRIKETHROUGH CSS
110
122
111
- `<span [ ngClass] ="task.isDone ? 'task-done' : 'task'" (click)="enableEditing()" \* ngIf="!editable" style="cursor: pointer ;" >
112
- </span >`
123
+ ```html
124
+ <span [ngClass ]="task.isDone ? 'task-done ' : 'task'" (click)="enableEditing()" \* ngIf="!editable" style="cursor :pointer;" >
125
+ </span >
126
+ ```
113
127
114
128
# How to make DRAG & DROP TODO
115
129
116
- 1 ) Install DndModule
130
+ ## 1) Install DndModule
117
131
118
- npm install ng2-dnd --save
132
+ ` npm install ng2-dnd --save`
119
133
120
- 2 ) Update App.module.ts
134
+ ## 2) Update App.module.ts
121
135
136
+ ```typescript
122
137
import {BrowserModule } from "@angular /platform-browser";
123
138
import {NgModule } from '@angular /core';
124
139
import {DndModule } from 'ng2-dnd ';
@@ -132,7 +147,8 @@ Visit : https://nodejs.org/en/download/
132
147
})
133
148
export class AppModule {
134
149
}
150
+ ```
135
151
136
- # Angular 2 Bootstrap + Bootstrap Styling
152
+ # Angular 2 Bootstrap + Bootstrap Styling
137
153
138
154
Using bootstrap components in Angular 2 Visit: https://valor-software .com/ng2-bootstrap /#/
0 commit comments