To create a Web Application in AngularJS, using Entity framework, Web API and LINQ step by step:
Step 1
Open Visual Studio and create a new project, example: LeaveManagementSystem for the client side work.
Step 2
Add another project with the same solution or other project for the use of the Server side work Web API.
Step 3
In the first project for client side use, just create four folders, where the 1st is Controller, the 2nd is Services, the 3rd is directive and the 4th is view for the reference downloaded zip code.
Step 4
- Add Java script page for app.js
- Add Java script page for route.js
- Add HTML page for folder index.html
These three pages are most important. After that: - Add HTML page for in view folder login.html
- Add JavaScript for in controller folder loginContoller.js
- Add JavaScript for in services folder loginServices.js
Step 5
In another project, add entity edmx file for the database. Afterwards, in controller, create login controller and call entity with LINQ query.
Important
- When to hit a request from HTML page -> AngularJS controller -> AngularJS Service -> Web API contoller.
Here, if you try to access other projects to access the data, use CORS, which is more important to know about.
See Web API project app. Start folder .cs file and it enables CORS to allow other applications to access Web API.