Live data from Hacker News

AngularJS Tutorial: Learn to Build Modern Web Apps

thinkster.io

71–80 of 93 posts

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#71
post #5

One advantage of the MEAN stack is that you only need to know javascript to start developing on it, which saves time and brainpower to get started. That being said, I'm curious if there are other advantages to learn the MEAN stack?

I've just kicked off my latest project using the MEAN stack.

The main advantage for using the stack has been a huge time saving in getting the project set up. NodeJS and express is hugely flexible about how you structure your source, which can also be a downfall in the additional mental load of deciding where stuff should go. MEAN does this for you.

The disadvantage has been where I want to do things differently from how MEAN is set up. For example, MEAN uses Bootstrap v2, I wanted Bootstrap v3. It was a slight faff updating it. It would probably be harder if you eg. wanted to use MySQL instead of MongoDB.

There is still a lot that you need to learn before you will get an app fully up and running, but with MEAN you can get cracking on stuff before you know it all. I don't know anything about Grunt yet, but can still use the Grunt file provided to run the server.

Well worth using in my opinion.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#72
The tutorial recommends starting your server using `node server`.

With MEAN a Grunt file is provided. Running the server with `grunt` will make grunt run the server and then watch the directory for changes - restarting the server and refreshing the page as necessary.

Much easier.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#73
post #67

Hey all - we'd love to hear any questions, criticism, or ideas you have. Also, we have a pdf version of the ebook available for $25 on the site, but we'd like to give all of you on HN a 20% discount. You can go to this URL to get the cheaper price - http://gum.co/SUry/awesomehners Thanks for all of your support!

Edit: Nevermind.

[deleted]

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#74

Hey all - we'd love to hear any questions, criticism, or ideas you have. Also, we have a pdf version of the ebook available for $25 on the site, but we'd like to give all of you on HN a 20% discount. You can go to this URL to get the cheaper price - http://gum.co/SUry/awesomehners Thanks for all of your support!

Like I said in another comment, the git clone command should be fixed to use https instead of ssh. That way it would be able for users that have no access to the repository (almost anyone) to clane it without any problems.

  git clone https://github.com/msfrisbie/mean-stripdown.git

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#76
post #52

Earlier quoted context omitted.

Can you give an example of how you've organised the modules? Like one per model (a products module) or by section of the site?

If I'm not mistaken, instead of splitting into: controllers/ users.js teams.js models/ user.js team.js Just have: modules/ users.js teams.js Where model and controllers for each function is defined within a single file. I've switched to this convention as well - less context switching of files.

I don't understand what you would have in "models". Services?

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#77
post #51

Working with a large Angular app, I've found it much nicer to split away from the "Rails"-style convention of grouping by type (controllers, models, etc) and instead grouping by modules. This plays especially well with Angular where you can group everything within a module together and include a single module which ties all the dependencies together. Curious if others do something similar and group code together by m…

I'm always excited to structure my projects in a different more effective way - well, it's more of a struggle - anyway, this sounds interesting. Can someone elaborate on the file structure and structure of files and the way they connect? I'm rolling with a MVP structure that frankly is becoming cumbersome with my current project's size.

What I've done myself and found it pretty scalable is as follows:

appShell/ views/allbaseviewshere viewmodels/controllers or viewmodels for the core views services/baseservices moduels/ account /views/ /viewmodels/ /services/ order /views/ /viewmodels/ /services/ /controllers/ static /css/ /js/ /images/

AppShell contains the app starter page, controllers and util services (showing popups, utility functions etc.) AppShell/Views contains all the UI Skelton for the app (bootstrap main page, etc)

Every folder inside "modules" contains views, controllers (viewmodels) and services belongs to only that module. Account folder contains views for user registeration, sign in, change user profile, etc. etc.

This way you can keep building new moduels in their respective folders without touching the frozen code (already built modules).

Each module talk to outside world using "services". No module can touch anything belongs to other modules but with "services".

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#78
I'm still not convinced about Angular's Dependency Injection thing. The problems it allegedly solves don't clearly outweigh the ones it certainly creates.

It claims to provide concern isolation, which facilitates testing and cleanliness. I don't think it helps that much.

But it has a middle-stage learning curve, more callbacks than I'd like, and implicitness of dependencies. For example, i.e. you need to know what $scope-like params are "supposed to contain" on every function that uses them.

Also, I find the naming spotty: "directive", "module", "injector", "compile" etc. lack specificity. They are not as bad as "Manager", "Data", "Info" and "Object", but they are not good.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#79
post #72

The tutorial recommends starting your server using `node server`. With MEAN a Grunt file is provided. Running the server with `grunt` will make grunt run the server and then watch the directory for changes - restarting the server and refreshing the page as necessary. Much easier.

I tried to use grunt as you say with the tutorial, but it didn't work. They say they are using a stripped down version of MEAN, so maybe they took that out? Do you know a good tutorial on adding it back in, as I like the sound of the functionality you're talking about...

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#80
post #79
post #72

The tutorial recommends starting your server using `node server`. With MEAN a Grunt file is provided. Running the server with `grunt` will make grunt run the server and then watch the directory for changes - restarting the server and refreshing the page as necessary. Much easier.

I tried to use grunt as you say with the tutorial, but it didn't work. They say they are using a stripped down version of MEAN, so maybe they took that out? Do you know a good tutorial on adding it back in, as I like the sound of the functionality you're talking about...

Yes. They have stripped out the gruntfile. Just copying this from the original project into your solution should work.

https://github.com/linnovate/mean/blob/master/gruntfile.js

Make sure you have grunt installed.

http://gruntjs.com/

Post reply on HN