1.0.5 • Published 6 years ago

toast-dev007 v1.0.5

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Project Title

toast-dev007

Getting Started

install the package with this command: npm i toast-dev007

Add this line in the your App module

import { ToastModule } from 'super-toasty'; <-- Add this

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    . . . . ,
    ToastModule.forRoot({ brand: 'XYZ' }) <-- Add this
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Add this line in the your App component

import { ToastService } from 'super-toasty'; <-- Add this

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  title = 'newApp';
  constructor(
      private toastServ: ToastService <-- Add this
) {}
  ngOnInit() {

  }
  MakeToast() {
    this.toastServ.showToast('error', 'My Title', 'Body of the toast'); <-- use this to show toast
  }
  closeToast() {
    this.toastServ.clearToast(); <-- use this to remove toast
  }
}

There is only two themes available for this toast
send 'success' or 'error' as first parameter and then send the Title, the Body, and time (optional) as the parameter to the showToast method
this.toastServ.showToast('error', 'Title', 'Body', 5000);

Deployment

Add additional notes about how to deploy this on a live system

Built With

Authors

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.0.1

6 years ago