Giter Site home page Giter Site logo

mean-contactlist-angular2's Introduction

Mean Contactlist Angular2

Contact List is a RESTful API server and web application built with the MEAN (Angular 2) stack. It is a simple example that aims to concisely demonstrate basic MEAN and REST architecture. You can find the full tutorial here: https://devcenter.heroku.com/articles/mean-apps-restful-api.

You can deploy a live copy of this application to Heroku with the button below.

Deploy

mean-contactlist-angular2's People

Contributors

angular-cli avatar tfogo 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  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

mean-contactlist-angular2's Issues

TypeError: Parameter "url" must be a string, not undefined

When cloning the repo and running it with 'heroku local' I get the above error. I have all dependencies installed, downloaded npm and nodejs latest versions, and my config var for mLab seems to be fine too. Any ideas for what the problem is?

Update does not work

Trying to learn more about use of PaaS and Heroku in question, and used this as a nice Node.js tutorial and first touch in doing rest setup with it. Seems to work great, but I noted that there's one problem.

If you try to update the contact, it does not seem to stick. Refreshing site the contact will return back to like it was on creation. I tried looking into it but I am not quite sure what the issue is.

Edit: More precisely seems to be about receiving the right ID.

core.js:1633 ERROR Error: Uncaught (in promise): TypeError: Cannot read property '_id' of undefined TypeError: Cannot read property '_id' of undefined at ContactDetailsComponent.ContactListComponent.updateContact [as updateHandler] (contact-list.component.ts:76) at contact-details.component.ts:32 at

contact.service.ts Promise issue

Hello, I am receiving the following types of error in the contact.service.ts script. I am receiving four different errors of these type one for each of the following methods getContacts(), createContact(...), deleteContact(...), updateContact(...). I am using visual code, which is how I identified the error below.

severity: 'Error'
message: 'Type 'Promise<void | Contact[]>' is not assignable to type 'Promise<Contact[]>'.
Type 'void | Contact[]' is not assignable to type 'Contact[]'.
Type 'void' is not assignable to type 'Contact[]'.'
at: '17,7'
source: 'ts'

Github branch can't be cloned and then uploaded on Heroku

After cloning the branch and added all files on Heroku, I got the error Cannot read property 'config' of null during the git clone heroic master step. After searching web for a while I found that the problem can be solved by creating a new project (using ng new) and copy the '.angular-cli.json' into your branch, then the project can be deployed and everything works.

package.json- "postinstall":"ng build" build failed

Hello, I am try to follow the directions on how to setup the mean contact list from the heroku link: https://devcenter.heroku.com/articles/mean-apps-restful-api#define-the-contact-class

I ran into another issue when trying to git push heroku master, where the build fails at the "postinstall":"ng build" step of the package.json file. When I do not include "postinstall":"ng build" in the package.json it was able to build, but when I ran heroku open none of the angular code appeared and the browser just outputted the following: Cannot GET /.

The build error message when trying to build with "postinstall":"ng build" is as follows"

remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > [email protected] postinstall /tmp/build_7139d1c89bf1b25a5122707c093fcaee
remote: > ng build
remote:
remote: sh: 1: ng: not found
remote: npm ERR! file sh
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno ENOENT
remote: npm ERR! syscall spawn
remote: npm ERR! [email protected] postinstall: ng build
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] postinstall script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2017-08-02T20_55_51_819Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to infinite-gorge-38681.
remote:
To https://git.heroku.com/infinite-gorge-38681.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/infinite-gorge-38681.git'

Throwing errors while running the program

hello , iam trying to run(npm start ) your program using Angular CLI but the program is throwing error like
npm-debug.log while i had no issues while installing the program (npm install) , i hope you know why its throwing errors and you will help me fix it

Where is CONTACTS_COLLECTION schema defined?

var CONTACTS_COLLECTION = "contacts";

I've realized that CONTACTS_COLLECTION is just set to a string called "contacts"..not really a Schema or a model for MongoDB

db.collection(CONTACTS_COLLECTION).find({}).toArray(function(err, docs) {

Here, you're using CONTACTS_COLLECTION (which I assume is just a string "contacts")... I am sorry, I don't get the logic here. Have you declared Schema for CONTACTS_COLLECTION somewhere else?

Thank you

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.