Skip to content

Commit 7b627ef

Browse files
authored
Update README.md
1 parent f651399 commit 7b627ef

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

README.md

+33-17
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,24 @@ Visit : https://nodejs.org/en/download/
3939

4040
## 4) Once installed you need to import our main module
4141

42-
`import {NgbModule} from '@ng-bootstrap/ng-bootstrap';`
42+
```typescript
43+
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
44+
```
4345

4446
## 5) Need to add imports in AppModule
4547

4648
Example :
4749

48-
`@NgModule({
50+
```typescript
51+
@NgModule({
4952
declarations: [AppComponent, ...],
5053
imports: [NgbModule.forRoot(), ...], // forRoot is used to add application/singleton services.
5154
bootstrap: [AppComponent]
5255
})
5356

5457
export class AppModule {
55-
}`
58+
}
59+
```
5660

5761
## 6) Install bootstrap (Using only for CSS reference)
5862

@@ -62,26 +66,31 @@ Visit : https://nodejs.org/en/download/
6266

6367
Example :
6468

65-
`"styles": [
69+
```css
70+
"styles": [
6671
"styles.css",
6772
"../node_modules/bootstrap/dist/css/bootstrap.css"
68-
]`
73+
]
74+
```
6975

7076

7177
# TODO COMPONENT TEMPLATE
7278

73-
`<div class="container">
79+
```html
80+
<div class="container">
7481
<div class="col-xs-2">
7582
<ul class="list-group">
7683
<li class="list-group-item">
7784
</li>
7885
</ul>
7986
</div>
80-
</div>`
87+
</div>
88+
```
8189

8290
# TASK COMPONENT TEMPLATE
8391

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">
8594
<div class="container">
8695
<div class="row">
8796
<div class="col-sm-1">
@@ -95,30 +104,36 @@ Visit : https://nodejs.org/en/download/
95104
<span class="fa fa-trash-o" style="cursor:pointer;"></span>
96105
</div>
97106
</div>
98-
</div>`
107+
</div>
108+
```
99109

100110
# FORM Validation css
101111

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' : ''">
103114
<input type="text" class="form-control input-sm form-control-danger" id="task" placeholder="Add a task" formControlName="updatedTask" focus/>
104115
<div class="form-control-feedback" \*ngIf="form.get('updatedTask').hasError('required') && isSubmitted">
105116
Task name is required
106117
</div>
107-
</div>`
118+
</div>
119+
```
108120

109121
# STRIKETHROUGH CSS
110122

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+
```
113127

114128
# How to make DRAG & DROP TODO
115129

116-
1) Install DndModule
130+
## 1) Install DndModule
117131

118-
npm install ng2-dnd --save
132+
`npm install ng2-dnd --save`
119133

120-
2) Update App.module.ts
134+
## 2) Update App.module.ts
121135

136+
```typescript
122137
import {BrowserModule} from "@angular/platform-browser";
123138
import {NgModule} from '@angular/core';
124139
import {DndModule} from 'ng2-dnd';
@@ -132,7 +147,8 @@ Visit : https://nodejs.org/en/download/
132147
})
133148
export class AppModule {
134149
}
150+
```
135151

136-
# Angular 2 Bootstrap + Bootstrap Styling
152+
# Angular 2 Bootstrap + Bootstrap Styling
137153

138154
Using bootstrap components in Angular 2 Visit: https://valor-software.com/ng2-bootstrap/#/

0 commit comments

Comments
 (0)