In this section, we will talk about Angular Life Cycle hooks. Angular supports couple of life cycle hooks. Let’s take a closer look at that. In a nutshell, whenever any new component gets created, Angular goes to couple of different phases in this creation process. This also gives us opportunity to hook into different phases and utilize the same to its maximum. Below is the glimpse of ng-hooks in sequential order.
In this section, we will talk about template reference. Now, in the Movies.Component.html file, we are already using ngModel and that is fine as we can get data via this way as well. Local reference is the way to get any HTML template access. Now, this variable will hold reference to this HTML element.
In this section, we will continue from the last section, where we have seen Event Binding via @Output decorator. Like @Input decorator, we can also assign alias to @Output decorators like shown below. In that case, you need to listen to this alias as well.
In this section, we will extend our existing example to new level. Many a times it happen, that InputType, which we are referring, we don’t want to use the same property outside the component. Therefore, in that case, we may use alias for @Input() types.
In this section, we will get started with simple angular components and then we will isolate the structure into different components and then try to communicate between the components. For this post, readers are expected to have basic working knowledge of Angular 2/4 and how to scaffold projects with Angular CLI. With that being said let’s get started. Below, I have created simple angular 4 project via CLI.
In this section, we will talk about another way, via which we can inherit prototypes. Here, I’ll be using Object.Create to use the same. In the last section, we have seen function constructor pattern to create objects from the blueprint. With that object.create() method, things work bit differently. In this case, we first define an object which will act as a prototype and then create a new object based on that very prototype.
In this post, I thought of addressing one of the errors which many of friends have been asking since few days. Actually, angular template under dotnet stack has been changed. For more info around the same, please refer my earlier post http://myview.rahulnivi.net/dotnet-angular-aurelia-knockout-react-redux-vue/. It means developers when used to execute angular template either via dotnet cli command or via yeoman generator, there used to be app.module.ts file. At this moment, when I try creating new component say ng g c movies, this will give below error.
Thought to share new additions around dotnet cmd. I guess with these additions, this may be the perfect timing for building SPA (Single Page APP) with ASP.NET Core as backend and any of the below listed libraries as Front-end choice.
Recently, I came across a project which is actually written in silverlight which means basically its a desktop app. However, there is web version of that as well there where in it works with Kendo+Jquery combination. Since, its JQuery, hence every developer has got their own way of implementation which is a pain in maintaining and scaling the project. I discussed with my team and thought of writing the same in such a way that still the existing stack will be working and side by side; I will be pushing the same on Angular 4. Kind of monumental task as this is not greenfield project where I have the choice to choose tools of my choice.