Skip to main content

angular bootstrap - How to show an alert

Bootstrap Installtion

// Installation for Angular CLI
ng add @ng-bootstrap/ng-bootstrap
app.component.html

<h4 style="padding:25px;">
    Angular Bootstrap - Show An Alert
</h4>

<p>
    <ngb-alert [dismissible]="false">
      <strong>Warning!</strong>
      This is a simple alert using angular bootstrap.
    </ngb-alert>
</p>
app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

// for angular bootstrap
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgbModule // for angular bootstrap
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
More Angular tutorials