Step 1: npm install toastr –save Step 2: import angular.json file toastr.min.css in styles and toastr.min.js in scripts Step 3: Add a click event before that create a common service (step 4) Step 4: create a service file toastr.service.ts into app/common folder
Tag: Service
Creating your first service in Angular
At first creating event.service.ts file into app/events/shared event.service.ts file import service file in app.module file Import service file and inject into event-list.component.ts event-thumbnail.component.ts file
Retrieving data for Select elements
Step 1: user-settings-form.component.ts file Step 2: data.service.ts file Step 3: user-settings-form.component.html file
Creating a Service in Angular
Step 1: create a data-service.ts file in data folder Note: ng command – ng g s data import user-settings file Step 2: in user-settings-form.component.ts file import bellow those two files Step 3: in user-settings-form.component.html file {{userSettings | json}}