Giter Site home page Giter Site logo

onehungrymind / ng2-rest-app Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 75.0 240 KB

A simple Angular 2 REST-ful app built using the Angular CLI

Home Page: https://frontendmasters.com/courses/web-apps-angular-2/

TypeScript 69.12% JavaScript 4.73% HTML 21.95% CSS 4.21%

ng2-rest-app's Introduction

ng2-rest-app

A REST-ful master-detail application built using Angular 2 and angular-cli.

Dependencies

  • You must have node v >= 6.9 and npm v >= 3 installed (via brew install node or NodeJS.org);
  • Install Angular CLI via npm i -g angular-cli

Getting Started

There are two main parts to this application. The first is the REST API, for which we are using json-server. The second part is the Angular 2 application server which we will start using ng serve.

To get started run the commands below.

$ git clone https://github.com/onehungrymind/ng2-rest-app.git
$ cd ng2-rest-app
$ npm install
$ npm start

Then navigate to http://localhost:4200 in your browser.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve.

ng2-rest-app's People

Contributors

angular-cli avatar jdgarvey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ng2-rest-app's Issues

Isuse with npm start

Hi I an windows user and getting below error when i run the npm start command.

ERROR in C:/Users/neetesh.vishwakarma/angular2/new/ng2-rest-app/node_modules s/Subject.d.ts (16,22): Class 'Subject' incorrectly extends base class 'O vable'.

Error when calling npm-start

I'm getting the following error when calling 'npm start' and because of that 4200 port is not working.

I'm using:
npm version 3.10.6
node version 4.5.0

This is a sample of my CMD line
[1] W:\Training\Angular 2\Building Awesome Web Apps with Angular 2\ng2-rest-app\node_modules@ngtools\json-schema\src\schema-class-factory.js:34
[1] result.push(...indices);
[1] ^^^
[1]
[1] SyntaxError: Unexpected token ...
[1] at exports.runInThisContext (vm.js:53:16)
[1] at Module._compile (module.js:373:25)
[1] at Object.Module._extensions..js (module.js:416:10)
[1] at Module.load (module.js:343:32)
[1] at Function.Module._load (module.js:300:12)
[1] at Module.require (module.js:353:17)
[1] at require (internal/module.js:12:17)
[1] at Object. (W:\Training\Angular 2\Building Awesome Web Apps with Angular 2\ng2-rest-app\node_modules@ngtools\json-schema\src\index.js:3:30)
[1] at Module._compile (module.js:409:26)
[1] at Object.Module.extensions..js (module.js:416:10)
[1] ng serve exited with code 1
[0]
[0] > [email protected] server W:\Training\Angular 2\Building Awesome Web Apps with Angular 2\ng2-rest-app
[0] > json-server --watch server/api/db.json
[0]
[0]
[0] {^
^}/ hi!
[0]
[0] Loading server/api/db.json
[0] Done
[0]
[0] Resources
[0] http://localhost:3000/items
[0] http://localhost:3000/widgets
[0]
[0] Home
[0] http://localhost:3000
[0]
[0] Type s + enter at any time to create a snapshot of the database
[0] Watching...

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.