Step 1: events-app.component.ts file Step 2: routes.ts file Step 3: app.module.ts file Step 4: index.html file. Added our base tag
Month: December 2019
Angular Component Interaction – Output Decorator
event-thumbnail.component.ts event-list.component.ts file app.module.ts file
Wrapping third party service in Angular
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
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
style and ngStyle binding in Angular
event-list.component.ts file event-thumbnail.component.ts file app.module.ts file
Class and ngClass binding in Angular
event-list.component.ts file event-thumbnail.component.ts file app.module.ts file
Deploy your Angular app to GitHub pages directly
In this tutorial we’ll see how to host an Angular 6 web application using Github Pages. Let’s get started. Prerequisites You need to have Node.js, NPM and Angular CLI installed, you also need to generate a new Angular 8 project using Angular CLI . Step 1: ng new child-demo in Visual Studio IDE terminal Step…Continue reading Deploy your Angular app to GitHub pages directly
Reading Local JSON Files Using Angular HttpClient
You can use to import JSON files in your Angular application is Angular HttpClient. Let’s see this by example. First, you need to import HttpClientModule in your app. Open the src/app/app.module.ts file and update it as follows: Next, add data.json file to the src/assets folder. Next, open the src/app/app.component.ts file, import and inject HttpClient as follows: Next, open the src/app/app.component.html file Source Code File
Angular Component Interaction – Input Decorator
app.module.ts file app.component.html file app.component.ts file child.component.html file child.component.ts file
Inter Component Interaction Way
Input() Decorator Output() Decorator Getters and Setters ngOnChanges() Template Reference Variables ViewChild() Emitting events Services