Setting up a MEAN4+ App (MongoDB, Express.js, Nodejs, Angular)

Share
Embed
  • Published on Aug 11, 2017
  • Written tutorial: goo.gl/pCKGiP
    coursetro.com for more awesomeness!
    Github repo for this project:
    github.com/designcourse/mean4plus
    - - - - - - - - - - - - - - - - - - - - - -
    Subscribe for NEW VIDEOS weekly!

    My site: coursetro.com
    My personal FB account: fb.com/logodesigner
    Coursetro FB: fb.com/coursetro
    Coursetro's Twitter: twitter.com/designcoursecom
    Join my Discord! discord.gg/a27CKAF
    ^-Chat with me and others
    - - - - - - - - - - - - - - - - - - - - - -
    Who is Gary Simon? Well, I'm a full stack developer with 2+ decades experience and I teach people how to design and code. I've created around 100+ courses for big brands like LinkedIn, Lynda.com, Pluralsight and Envato Network.
    Now, I focus all of my time and energy on this channel and my website Coursetro.com.
    Come to my discord server or add me on social media and say Hi!
  • Howto & StyleHowto & Style

Comments • 124

  • DesignCourse
    DesignCourse  Year ago +4

    Sorry about my voice/being monotone, I've had a sore throat for a damn week!

    • Marcos Guimaraes
      Marcos Guimaraes Year ago

      It was ok

    • HAIFA Ben Slama
      HAIFA Ben Slama Year ago

      I have the same problem :( Could you help us please :)

    • shweta mahure
      shweta mahure Year ago

      DesignCourse hey i followed the same steps and exact code but when i hit localhost:3000/api/users i do not get the users list whats could be the reason

    • **
      ** Year ago

      great vid ... could you kindly explain the closure() bit? cheers.

    • Vitaliy Podolskiy
      Vitaliy Podolskiy Year ago

      What about, to do setting up, with nestjs.com ? it's very similar with angular. I will be interested that. Thank you!

  • Anshu Johri
    Anshu Johri 22 days ago

    Idk why but bunch of things are missing already and those are already written in your code

  • Dushant Jung Kwr
    Dushant Jung Kwr 28 days ago

    error thrown when start node server and after i browser
    : Error: ENOENT: no such file or directory, stat '/Users/dushantkwr/mean/public/main.html'

    • Anshu Johri
      Anshu Johri 22 days ago

      i saw that html file is not inside dist, actually there is another folder called mean(in my case) in which the html file contains but now i'm not getting an error but getting a blank white page xD
      edit: i solved it. Just change the directories to new ones in server.js

  • Akhil Kandibanda
    Akhil Kandibanda Month ago

    great

  • Waleed Umer
    Waleed Umer 4 months ago

    Very nice and simple tutorial.
    I am having an issue, i receive 404 error after publishing on the server. How to fix that?

  • Palash Mandal
    Palash Mandal 7 months ago

    Hi Gary,
    I have got an error like " ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'api/users''".
    Also FYI. I've using Node 8.12.0 & npm 6.4.1.
    could you please help me out with that ASAP ?

  • Brad Ford
    Brad Ford 8 months ago

    Running "node server" does nothing.. Doesn't say it's running. It says nothing and just goes to the next command prompt.
    Running 'node -v' says I have version 8.11.1 installed.

  • Pixsa
    Pixsa 10 months ago

    how did you make C:\Users\gary\code[no arrow] command

  • Garrett Love
    Garrett Love 10 months ago

    Do you have to build the angular app every time you want to test out stuff? Is it ok to, for example, run the express server through a separate terminal window and then use ng serve to to test the Angular app that way?

  • kammampati srikanth
    kammampati srikanth 10 months ago

    How to solve this type Error
    module.js:549
    throw err;
    ^
    Error: Cannot find module '../server/routes/api'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object. (C:\Users\Pratik Ventures\chatapplication\server.js:7:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

  • Andrea B.
    Andrea B. 11 months ago

    Straight to the point! Awesome!

  • Abhijit Prakash Gawankar

    getting error while running node server.. anyone can help
    assert.js:42
    throw new errors.AssertionError({
    ^
    AssertionError [ERR_ASSERTION]: missing path
    at Module.require (module.js:594:3)
    at require (internal/module.js:11:18)
    at Object. (D:\appData\mean\server\routes\api.js:3:21)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

  • Muhammad Rafi
    Muhammad Rafi Year ago

    I want to build production with angular and node.js. Anyone suggest me how to do this because i am building app with election and i wan to communicate api same time.

  • theDevCouch
    theDevCouch Year ago +1

    Angular by default wanted to build the distributable under dist/mean/ rather than directly under dist/. Had to modify angular.json to change the output directory

    • Game 733
      Game 733 4 months ago

      you sir saved my hours of efforts

    • Marco Aguilar
      Marco Aguilar Year ago

      I'm new to Angular and I don't know if that's good practice, but it fixed my annoying problem! Thank you!

  • theDevCouch
    theDevCouch Year ago

    May also be necessary to install the rxjs-compat library as it is a dependency for rxjs/add/operator/map. `npm install rxjs-compat --save`

    • Ryan Kirkland
      Ryan Kirkland Year ago

      It's 100% necessary I think. You saved me haha. Thanks!

  • giridhar bharadwaj
    giridhar bharadwaj Year ago +2

    I'm getting error "Uncaught SyntaxError: Unexpected token

  • Khanh Lê
    Khanh Lê Year ago +3

    I've got the error "db.collection is not a function". What happen to this? I follow along your video

    • Garrett Love
      Garrett Love 10 months ago

      Thanks for this. For anyone watch this video, this comment fixed this error for me on Mongo 4.0 - Angular 6

    • Khanh Lê
      Khanh Lê 11 months ago

      Prateek Pandey I think it did not work for newer version of Angular

    • Prateek Pandey
      Prateek Pandey 11 months ago +3

      const connection = function(closure) {
      return mongoClient.connect('mongodb://localhost:27017/', function(err, db) {
      if (err) return console.log(err);
      var dbo = db.db('mean');
      closure(dbo);
      });
      };
      this did the trick for me I guess it will help you too

    • Bhanu Prakash
      Bhanu Prakash Year ago

      Khanh Le: That worked for me! Thanks mate :)

    • Khanh Lê
      Khanh Lê Year ago +1

      So, first of all, you need to install mongojs module: npm install --save mongojs.
      And then, add the following code to your js file:
      const mongojs = require('mongojs');
      const db = mongojs('YOUR_CONNECTION_STRING');
      And get access to any collection in your current db by using db.COLLECTION_NAME.find(callback);
      e.g db.Student.find((err, students) => { console.log(students) });

  • Ujjwal Khairnar
    Ujjwal Khairnar Year ago

    Can you please add tutorial for Mean 4 with typescript on server

  • Pedro Figueiredo
    Pedro Figueiredo Year ago

    in api.js seems to me that creating an object with let response = {} and using that object for all responses is bad practice. just imagine you get an error and you change the instance status to 501... all other responses will have that status (501) because in the normal response you don't set the status nor the message just the data. what am I not seeing correctly? for me, the correct way would be to create a class for this. (i'm new to express so i don't know the life cycle of the api.js but I imagine its long)

  • Ujjwal Khairnar
    Ujjwal Khairnar Year ago

    Thank you very much for this tutorial. It is pretty much helpful.

  • Cesar Santos Visbal Lambis

    why do you use 3000 and no the 4200 port ?

  • Mrugank Patankar
    Mrugank Patankar Year ago

    Finally someone using the latest version of Angular and some sanity

  • Omar Habash
    Omar Habash Year ago

    The entry to my Agular app is written like this "dist/index.html" in server.js (just like ur tutorial) but angular dist did not provide an html file... there is one in source; when i tried it - i was given the html but none of the angular was working.... anybody?

  • Nic Tanghe
    Nic Tanghe Year ago

    I get the following error when attemting to browse to my db api.
    λ node server
    Running on localhost:3000
    C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\mongo_client.js:804
    throw err;
    ^
    TypeError: db.collection is not a function
    at connection (C:\Users\nicta\Code\WebCv\server\routes\api.js:32:12)
    at MongoClient.connect (C:\Users\nicta\Code\WebCv\server\routes\api.js:11:9)
    at result (C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\utils.js:413:17)
    at executeCallback (C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\utils.js:405:9)
    at C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\mongo_client.js:271:5
    at connectCallback (C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\mongo_client.js:940:5)
    at C:\Users\nicta\Code\WebCv\node_modules\mongodb\lib\mongo_client.js:801:11
    at process._tickCallback (internal/process/next_tick.js:112:11)

  • Mustakrakish
    Mustakrakish Year ago

    Subbed. This is great, man.

  • Adrian Dinu
    Adrian Dinu Year ago

    Hy , i tried the code above all well and nice but there is a little problem when you are starting to use the angular router. If the Client is refreshing the page (F5) all the api send with .json({message: 'stuff'}) will be displayed; Example the angular route that will get you there is [routerLink]="['/users']" and on the backend you have a rotuer.get('/users', (req,res) => res.send({user : user})) everything will be fine untill the client refreshes the page. Do you have an ideea hou to get around that? It is so tricky did not see anyone doing this yet

  • chrisheney
    chrisheney Year ago

    Great tutorial. Going to buy a membership on coursetro as I've found several of your videos helpful. Thank you!
    Some feedback from a do-it-as-you-watch person: Many are use to ng serve via angular-cli ... it would have been very cool for you to have gone over configuring proxy.conf.js as part of WebPack, and even contrasting it to Browsersync initiated by gulp. Just my 2 cents.

  • Spider Man
    Spider Man Year ago

    I went through this video and followed along with writing the code and i got the following error, please give some advice:
    C:\mean4>node server
    module.js:540
    throw err;
    ^
    Error: Cannot find module 'C:\mean4\server'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
    I have the MongoDB correctly installed as following the video, but when i did the npm install mongodb --save it was a bit different than the video as follows:
    C:\mean4>npm install mongodb --save
    npm WARN rollback Rolling back node-pre-gyp@0.6.39 failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\mean4\node_modules\fsevents\node_modules'
    npm WARN rollback Rolling back tar-pack@3.4.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\mean4\node_modules\fsevents\node_modules'
    npm WARN rollback Rolling back ajv@4.11.8 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\mean4\node_modules\fsevents\node_modules'
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    + mongodb@3.0.3
    added 5 packages in 13.659s
    Please help thank you!

    • Scott Selke
      Scott Selke Year ago

      You are not in the right directory. You need to go into C:\mean4\src and then run node server.
      Also, be sure to change // API file for interacting with MongoDB
      const api = require('./server/routes/api');
      TO
      // API file for interacting with MongoDB
      const api = require('../server/routes/api');

  • Computer Analyst
    Computer Analyst Year ago

    Guys, Important Update : Please Note For MongoDB Users with version 3 or later :
    .
    .
    The modified "api.js" is given below + fully fixed the code & it's working after facing the problem of db.collection error :
    .
    .
    /*edit is done in //connect portion of the code & for better understanding i have provided the whole code of modified "api.js"*/
    .
    .
    const express = require('express');
    const router = express.Router();
    const MongoClient = require('mongodb').MongoClient;
    const ObjectID = require('mongodb').ObjectID;
    // Connect
    const connection = (closure) => {
    return MongoClient.connect('mongodb://localhost', (err, client) => {
    if(err) throw err;
    var db = client.db('mean');

    db.collection('users').findOne({}, function (findErr, result) {
    if (findErr) throw findErr;
    console.log(result.name);
    client.close();
    });

    //if (err) return console.log(err);
    closure(db);
    });
    };
    // Error handling
    const sendError = (err, res) => {
    response.status = 501;
    response.message = typeof err == 'object' ? err.message : err;
    res.status(501).json(response);
    };
    // Response handling
    let response = {
    status: 200,
    data: [],
    message: null
    };
    // Get users
    router.get('/users', (req, res) => {
    connection((db) => {
    db.collection('users')
    .find()
    .toArray()
    .then((users) => {
    response.data = users;
    res.json(response);
    })
    .catch((err) => {
    sendError(err, res);
    });
    });
    });
    module.exports = router;
    -----------------------------------------------------
    Thank You :)

  • Matt Bakken
    Matt Bakken Year ago

    For anyone getting errors trying to connect to their MongoDB server: check what version you're using. There is a different way to set up your api.js file when connecting to mongodb v3.0+. See this page for breaking changes: github.com/mongodb/node-mongodb-native/blob/3.0.0/CHANGES_3.0.0.md#api-changes.

  • Kostya Ostapuk
    Kostya Ostapuk Year ago

    show POST request. Please!

  • Akash Potdar
    Akash Potdar Year ago

    TRY THIS INSTEAD..!
    var dbMean;
    var collectionUser;
    // Connect
    const connection = (closure) => {
    return MongoClient.connect('mongodb://localhost:27017/', (err, client) => {
    if (err) return console.log(err);
    dbMean = client.db('mean');
    closure(dbMean);
    });
    };
    // Get users
    router.get('/users', (req, res) => {
    connection((dbMean) => {
    collectionUser = dbMean.collection('user');
    collectionUser
    .find()
    .toArray()
    .then((users) => {
    console.log(users);
    response.data = users;
    res.json(response);
    })
    .catch((err) => {
    sendError(err, res);
    });
    });
    });

  • Akash Potdar
    Akash Potdar Year ago

    Trying to hit localhost:3000/api/users, seeing the angular default page and tried with postman, i get the default angular template. Please need help.

  • s
    s Year ago

    Every time I watch these videos I get told to type npm in command and this and that will be installed. It never happens, I always get errors, why is this?

    • Hank Lancaster
      Hank Lancaster Year ago

      Make sure you have node installed. NPM is the node package manager.

  • Paul de Honor
    Paul de Honor Year ago +2

    If you´re using mongodb 3.x.x, try this solution:
    const dbName = 'mean';
    // Connect
    const connection = (closure) => {
    return MongoClient.connect('mongodb://localhost:27017', (err, client) => {
    if (err) return console.log(err);
    const db = client.db(dbName);
    closure(db);
    });
    };

  • shweta mahure
    shweta mahure Year ago

    hey i followed the same steps and exact code but when i hit localhost:3000/api/users i do not get the users list whats could be the reason

  • Mikey Cabana
    Mikey Cabana Year ago

    As per the the (changelog)[github.com/mongodb/node-mongodb-native/blob/3.0.0/CHANGES_3.0.0.md]
    we have to change this:
    const connection = (closure) => {
    return MongoClient.connect('mongodb://localhost:27017/mean', (err, db) => {
    if (err) return console.log(err);
    closure(db);
    });
    };
    to this:
    const connection = (closure) => {
    return MongoClient.connect('mongodb://localhost:27017/mean', (err, client) => {
    if (err) return console.log(err);
    let db = client.db('mean');
    closure(db);
    });
    };
    App will then work as expected.

  • Vidhya Sagar
    Vidhya Sagar Year ago +2

    Short and nice! I want to donate thousand dollars, but currently, cant afford. In the future, I will. Thanks for your tutorial! :)

  • Edwin Martinez
    Edwin Martinez Year ago

    How can we “watch” our front end and back end for changes automatically using package.json scripts?

  • Michael Morris
    Michael Morris Year ago +2

    @10:47 This command no longer works because it will install version 3.x of the node mongodb driver. The rest of the tutorial is written for 2.2.x. So use command
    npm install mongodb@^2.2.34 --save
    To pull a version of the driver compatible with the rest of the code used in the tutorial.

    • Bhanu Prakash
      Bhanu Prakash Year ago

      Okay. So is that the reason behind the error "db.collection is not a function"?
      I'm using Ubuntu 18.04 LTS

    • Hayden Witucki
      Hayden Witucki Year ago

      Thank you very much Michael.

  • Rouge Gorge
    Rouge Gorge Year ago

    Great tutorial! I used it and modified it, it's a pleasure to use. I would now include an element in my webpage that is refreshed every 10 seconds using api but I dont know where to put my code... The code is :
    function Controller($scope,MyService,$interval){
    /**
    * Loads and populates the notifications
    */
    this.loadNotifications = function (){
    MyService.getUsers().then(function(data){
    $scope.notification =data;
    });
    });
    //Put in interval, first trigger after 10 seconds
    var theInterval = $interval(function(){
    this.loadNotifications();
    }.bind(this), 10000);
    $scope.$on('$destroy', function () {
    $interval.cancel(theInterval)
    });
    //invoke initialy
    this.loadNotifications();
    }
    Can you give me an advice, searching the web I just find code with express generator but in this tutorial we use "ng new" so it's difficult to find the way...
    Thank you Gary!

  • Jorge Ibarra
    Jorge Ibarra Year ago +4

    I found another solution for the error given by db.collection if you´re using mongodb 3.x.x. First you have to install via npm the module mongojs and save it as a dependency. I´ll leave the code so that you can see how i did it:
    //// Code
    const express = require("express");
    const router = express.Router();
    const ObjectID = require("mongodb").ObjectID;
    const mongojs = require("mongojs");
    const db = mongojs("Name of the database", ["Name of the collection"]);
    // Error handling
    const sendError = (err, res) => {
    response.status = 501;
    response.message = typeof err == "object" ? err.message : err;
    res.status(501).json(response);
    };
    // Response handling
    let response = {
    status: 200,
    data: [],
    message: null
    };
    // Get users
    router.get("/users", (req, res, next) => {
    db.users.find((err, users) => {
    if (err) return next(err);
    response.data = users;
    res.json(response);
    });
    });
    module.exports = router;

    • Khanh Lê
      Khanh Lê Year ago

      You save my day

    • Matt Bakken
      Matt Bakken Year ago

      It just returns the client instead of the db itself. Weird, breaking change, but whatever
      Documentation for how to connect to MongoDB v3.0+ is here: github.com/mongodb/node-mongodb-native/blob/3.0.0/CHANGES_3.0.0.md#api-changes

    • Jorge Ibarra
      Jorge Ibarra Year ago

      I don´t know how mongojs works completely, but I guess that this line of code: "const db = mongojs("Name of the database", ["Name of the collection"]);" is similar as what you have above, but it has to be done this way because we´re using mongojs, which is a middleware that helps us to connect easily to MongoDB and do other stuff. Another middleware that I´ve used before for this task is mongoose, which for me is also great.
      I hope I helped you a little bit with my response and correct me if I´m wrong in anything :D

    • Akash Potdar
      Akash Potdar Year ago

      so we don't need use this part? const connection = (closure) => {
      // console.log(closure);
      return MongoClient.connect('mongodb://localhost:27017/mean', (err, db) => {
      if (err) return console.log(err);
      closure(db);
      });
      };

    • Jorge Ibarra
      Jorge Ibarra Year ago

      Glad to help :)

  • Kiran Mungekar
    Kiran Mungekar Year ago

    i am getting error as TypeError: res.sendFile is not function
    plzz help ...

  • Xia Wang
    Xia Wang Year ago

    hey, great tutorial ! which helped me a lot ! just want to thank you very much! Look forward to seeing more your tutorials. Great work! I went through the code, it works with me most.

  • Darren Booker
    Darren Booker Year ago

    I am following your tutorial from your website. I keep getting this error and can't figure out why please help
    (node:17285) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See mongoosejs.com/docs/connections.html#use-mongo-client

  • Ziteng Wang
    Ziteng Wang Year ago +6

    If you use MongoDB 3 and later, in server.js, db.collection will get a type error. Try this solution stackoverflow.com/a/47662979

    • Kade
      Kade Year ago

      Ziteng Wang I did downgrade because I couldn't fix the db.collection is not a function with the latest version. It was a quick fix. You are right...

    • Ziteng Wang
      Ziteng Wang Year ago

      LimCode don't do downgrade. We need to use the newer APIs when developing.

    • Kade
      Kade Year ago

      you can also fix the error by downgrading your mongodb v3 to mongodb: 2.2.31 and run npm install again. It will work fine. Thanks for the link

    • Alicia
      Alicia Year ago

      Thank you so much for posting this. Yeah I'm using MongoDB shell version v3.6.0. The solution by user MikaS in your link helped me.

  • Rigin Oommen
    Rigin Oommen Year ago

    How co consolidate the operations in ng build and npm start in single go

    • Dimitris Katsaros
      Dimitris Katsaros Year ago

      for the nmp start command you just have to install nodemon ( npm install -g nodemon ) and then run your server.js with the command nodemon server. What it does is watches over your project for any changes (save a change to any file) and automatically restarts your server. So now the only thing you have to do is run the ng build witch is pretty frustrating at a point after but i don't have any solution to that.

  • MrTimskii
    MrTimskii Year ago

    Great vid ! Thanks a lot.
    I tried to do the CRUD action by myself but it keeps giving an error in Postman.
    Do you know what's wrong with my code (post & put doens't work, Get does work) ? Thank you in advance !

    POST :
    router.post('/employees', (req, res) => {

    const employees = { name: req.body.name, age: req.body.age , wage: req.body.wage , place: req.body.place };
    db.collection('employees').insert(employees, (err, result) => {
    if (err) {
    res.send({ 'error': 'An error has occurred' });
    } else {
    res.send(result.ops[0]);
    }
    });

    });
    PUT :
    router.put('/employees/:id', (req, res) => {
    const id = req.params.id;
    const details = { '_id': new ObjectID(id) };
    const employee = { name: req.body.name, age: req.body.age , wage: req.body.wage , place: req.body.place };
    db.collection('employees').update(details, employee, (err, result) => {
    if (err) {
    res.send({'error':'An error has occurred'});
    } else {
    res.send(employee);
    }
    });
    });
    GET :
    router.get('/employees', (req, res) => {
    connection((db) => {
    db.collection('employees')
    .find()
    .toArray()
    .then((employees) => {
    response.data = employees;
    res.json(response);
    })
    .catch((err) => {
    sendError(err, res);
    });
    });
    });

    • Waseem Ullah Khan
      Waseem Ullah Khan Year ago

      Hello MrTimskii ,,, can u share your code with me for post and put .

    • MrTimskii
      MrTimskii Year ago

      Yes, i found my error .. thanks for taking time !

    • DesignCourse
      DesignCourse  Year ago +1

      Sorry, you would have much better luck posting your question at stackoverflow.com

  • Aakash Verma
    Aakash Verma Year ago +2

    Would have loved it if you'd have taken some time to explain the latter half of the video. Loved it anyway!

  • Milan
    Milan Year ago

    very nicely demonstrated !! thanks a lot for such a nice tutorial.

  • Igor Chornyi
    Igor Chornyi Year ago

    Hey, thanks for your tutorial. I have a question about this URL "localhost:3000/api/users". Is it a good thing that user can go to the URL and see that JSON response and is there any way to forbid that? Maybe redirect to index.html or something?

  • Cam
    Cam Year ago

    By far the most useful and to the point simple MEAN app with the R part of CRUD. Would love to see a part two in the future that delves more into the CUD parts. As well as adding some more angular components. such as different views.

    • DesignCourse
      DesignCourse  Year ago

      Thanks, I'll do more CRUD in the future with an emphasis on CUD. ;)

  • Mehdi alaoui sossai

    hey do you how can i upload using MEAN4?
    thank you

  • Omer Mindivanli
    Omer Mindivanli Year ago +5

    This video is the most important tutorial video for mean stack development. I have not seen that kind of it

  • Jonathan Juarez
    Jonathan Juarez Year ago

    Really clean and straight to the point! Quick question. Is this how a project may be setup to be put into a production dist folder for heroku or aws deployment?

  • srinivas muralidharan

    It says too many Database when i travel to the url : api/users. What should be the solution for this?

  • Valkon
    Valkon Year ago +1

    Oh FINALLY Angular 4

  • James Block
    James Block Year ago

    This was a great video. Just what I was looking for! I do have a question though...
    What is the best way to implement a css preprocessor like sass. Would you delete the main styles.css file in the angular dist folder and replace it with a styles.sass file and then point node-sass-middleware's src and dist options at that dist folder? What about all the individual component stylesheet partials? Is there a clean easy way to use sass with them?
    Im sure ill figure it out if I play around with it a bit. I've been using node and express for a while and recently decided to tackle learning angular, but the version of angular has been changing so much and the lack of documentation on setting up node and angular to work together has been more then discouraging. Thanks again for the video!

  • Stan None
    Stan None Year ago

    nice!
    i like!

  • Rijomon R
    Rijomon R Year ago

    for your connection code i have little bit doubt. I rewrite the connection code like this but, i didn't get the result why? can u please help anyone.
    const connection = function(closure) {
    return MongoClient.connect('db_url', function(err, db) {
    if (err) return console.log(err);
    closure(db);
    });
    };

  • bbfrancis23
    bbfrancis23 Year ago

    The course on the webpage is missing?

  • Gol D. Roger
    Gol D. Roger Year ago +9

    Can you make a full MEAN4 tutorial with deployment on Heroku.

  • Amar Shivers
    Amar Shivers Year ago

    ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (22,14): A parameter property is only allowed in a constructor implementation.
    ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (24,10): Property '_dataService' does not exist on type 'AppComponent'. if any chance anyone can identify how to fix this error?

  • Amar Shivers
    Amar Shivers Year ago

    hello there! , first thank you so much for this tutorial and if any chance can you identify this error ...? ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (22,14): A parameter property is only allowed in a constructor implementation.
    ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (24,10): Property '_dataService' does not exist on type 'AppComponent'.

    • ZRK MEDIA
      ZRK MEDIA Year ago

      in your app.component.ts, make sure you have a space between "private _dataService:"

  • Amar Shivers
    Amar Shivers Year ago

    hello, first thank you so much for the tutorial it's a big help for me as new in this field by the way why I've got an error even I've just copied and paste what you had? if any chance can you identify this error ...
    ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (22,14): A parameter property is only allowed in a constructor implementation.
    ERROR in /Users/amarshivers/Desktop/trackerApp/src/app/app.component.ts (24,10): Property '_dataService' does not exist on type 'AppComponent'.

    • Chris McElyea
      Chris McElyea Year ago

      If you did the import at the top of app.component.ts as showed in the video, your constructor should implement the DataService( constructor(private _dataService:DataService). That allows you to do this._dataService.getUsers().

  • Владислав Рыжов

    Amazing!!!

  • Gilfoyle
    Gilfoyle Year ago

    Is anyone else annoyed that there's soon going to be an Angular 5? Get it right before you release it, Google!

    • DesignCourse
      DesignCourse  Year ago

      It's not really unexpected though, they've had this roadmap planned for quite some time.

  • Liran Peleg
    Liran Peleg Year ago

    Hey Simon, Great video. One thing tho, Its not a very good practice to initialize Rx calls in the constructor. If you wanna do it , you better use the ngOnInit event hook. You can also skip it all together and use the async pipe to do it for you for a much safer code

  • IC Sniper
    IC Sniper Year ago

    hi simon, Im having a little problem with scaling in Adobe xd, before in xd the artboard, all you needed to do is to select the board and all of your element in it will have been selected and the board will scale with all your elements in it, but now when I do it only the background board gets scaled and i can't find a ways to make it as it was before can you help me?

  • Rajiv
    Rajiv Year ago

    Very nice

  • Shaun H
    Shaun H Year ago

    Can you explain this error? Sorry to spam your comments. I've SO & Googled.
    ~/Sites/mean-app :: npm config set prefix /usr/local
    ~/Sites/mean-app :: npm install @angular/cli -g
    npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@angular/cli/node_modules
    npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@angular/cli/node_modules/jsprim/node_modules
    npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@angular/cli/node_modules/verror/node_modules
    npm ERR! path /usr/local/lib/node_modules/@angular/cli/node_modules
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall access
    npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@angular/cli/node_modules'
    npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@angular/cli/node_modules'
    npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/@angular/cli/node_modules\'',
    npm ERR! errno: -13,
    npm ERR! code: 'EACCES',
    npm ERR! syscall: 'access',
    npm ERR! path: '/usr/local/lib/node_modules/@angular/cli/node_modules' }
    npm ERR!

  • TalkerTube
    TalkerTube Year ago

    Why not Koa.js instead of Express?

    • NikolaPolov
      NikolaPolov Year ago +5

      Maybe becouse MKAN stack sound not as good as MEAN

    • TalkerTube
      TalkerTube Year ago

      I really want to get the point why most of devs still use Express. Why not Koa? Koa is a next generation of Express. So why? Something wrong with it?

    • NikolaPolov
      NikolaPolov Year ago +1

      Go away !!! :)

  • Ninoop P George
    Ninoop P George Year ago

    Sir, is that the cmd?? How did you theme it?

  • NERO
    NERO Year ago

    senpai can you make a java script based that gets the IP of the CLIENT using the NODE.JS as a SERVER? seen many codes how but it's great to see a VIDEO TUTORIAL regarding this. been searching but can't find anything good tutorial regarding to this :-(

  • NikolaPolov
    NikolaPolov Year ago +5

    Great ! More MEAN stack videos please . This was one of the best video about MEAN stack becouse it was very simple ( maybe without this part about why you need to import UserId ) , but it was really great . I wait for more . And of course I think that you will complete this app .