Giter Site home page Giter Site logo

anhnguyen999 / angular2basiccrud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from debugmodedotnet/angular2basiccrud

0.0 1.0 0.0 27 KB

This repository contains project demonstrating CRUD operation in Angular 2

JavaScript 16.04% CSS 8.83% HTML 31.94% TypeScript 43.19%

angular2basiccrud's Introduction

Running the Application

Step 1

Create a table with schema shown as below. Give same column names with the cases. Id – string (PK) Title – String Status – String Insert some initial data in the table such that on running application will be loaded with some tasks. Make sure to insert done or pending as the value of status.

Step 2

REST API or Web API

Create a REST API which will perform CRUD operation on the table. You can create REST service using any development stack of your choice. Just make sure to follow standard of REST and all operations like PUT, POST, DELETE, and GET will be performed on the same URL.

If you wish to create ASP.NET Web API, my article on same may help you.

http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/06/05/a-step-by-step-guide-to-working-with-the-asp-net-web-api-and-angularjs.aspx

You may want to enable CORS also on the API, such that you can perform CRUD operation without Cross-Origin Request error. To enable CORS in ASP.NET Web API, my article on same may help you.

http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/08/31/how-to-enable-cors-in-the-asp-net-web-api.aspx

I would recommend to enable CORS on the global level.

Step 3

In the project open src/app/shared/data.service.ts file. In this file change value of apiUrl with the URL of Web API created by you.

apiUrl : string = "http://task.sourabhsomani.com/api/todotasks";

Step 4

Running the Application

  1. Install Node.js

  2. Run npm install to install app dependencies

  3. Run npm start to start the server and launch the app

angular2basiccrud's People

Contributors

debugmodedotnet avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.