I'm new to angular 4, I'm trying to configure bootstrap. I installed ng-bootstrap:
https://ng-bootstrap.imtqy.com/#/getting-started
I liked the page, but I do not see the boot page on my page. Here is my code:
SIC / application / app.module.ts
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { FormsModule } from '@angular/forms'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, // add this NgbModule.forRoot() ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
SIC / application / app.component.html
<div class="container"> <h1 class="text-primary">{{title}} </h1> <h2 class="text-primary">My Heroes</h2> <ul class="heroes"> <li *ngFor="let hero of heroes" [class.selected]="hero === selectedHero" (click)="onSelect(hero)"> <span class="badge">{{hero.id}}</span> {{hero.name}} </li> </ul> <div class="alert alert-success" role="alert"> <strong>Well done!</strong> You successfully read this important alert message. </div> <div *ngIf="selectedHero"> <h2>{{selectedHero.name}} details!</h2> <div><label>id: </label>{{selectedHero.id}}</div> <div> <label>name: </label> <input [(ngModel)]="selectedHero.name" placeholder="name"/> </div>
I also tried some code in index.html, but it doesnβt work,
for this line, I expect to see some color:
<h1 class="text-primary">{{title}} </h1>
I cannot find the link to bootstrap when I check the html header. Any help please? Thanks
angular twitter-bootstrap bootstrap-4 ng-bootstrap angular4-forms
MarcosF8
source share