In this article, I will cover how to build angular 2 component using Visual Studio 2017, I am using “Angular2VisualStudioTemplate” which is a free template and helps us to setup a initial angular 2 project structure. The main advantage with this is we do not need to write any gulp or tsconfig.json or package.json files all these things will be created by Angular 2 Visual Studio Template
You can install this by selecting angular 2 visual studio template which appears on the right side panel when you click on online template tab while creating a new project, you can refer below screen shot
Once the installation is successful then go to the File -> New -> select the Angular 2 project and click on ok button to create a new angular 2 project
If you go and see the right side solution explorer then you can find app folder containing sample angular 2 component along with the necessary configurations files which are required to execute this successfully
I don’t want to do any changes because I want to test this without writing single line of code, I am just going to press F5 to check the output, after pressing F5 I see below output, which means the angular 2 application is working fine
In addition to the sample component, I am planing to create a new registration component which allows end user to enter email,password and username on click of submit button the form will post data to the mongodb using rest API
First, we need to create a registration service and the service will have registerUser method which takes user object as a parameter, the http request takes this object and post it to the server
The registration component will make a request to registerUser method by passing user object as a parameter, we are using two way data binding to get the user object, when ever user enters or changes values in the input controls that will automatically available in the user object
Once everything is completed just hit F5 to see the user registration component
No related posts.
A technology enthusiast and a professional blogger from India. Through out my IT career, I have had the pleasure of working on various new technologies and built products like www.ziprides.com and some other products. Unfortunately, my attempts have not given me the desired results and as a result, I have finally decided to build a professional blog where I would like to share all my learnings and hoping to learn from other enthusiasts around the world.