Live data from Hacker News

AngularJS Tutorial: Learn to Build Modern Web Apps

thinkster.io

51–60 of 93 posts

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#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.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#52

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…

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.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#53
Looks like a solid walk through of building an angular app.

OT but the fantasy football twist is great. I only just started playing this year so I've been learning a lot. We're playing the uk version but I guess it's much the same. I've found it interesting how much strategy there is and how much data I can analyse.

We have a startup in the construction industry so wanted to use it as a tool for keeping a sort of weekly offline / banter conversation going on with clients. Turns out that I actually enjoy too!

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#54
Kind of surprised how in depth the tutorial goes, but only manages to mention the word "test" once and doesn't cover the fantastic testing back end included with the AngularJS seed (https://github.com/angular/angular-seed).

Unless the person learning AngularJS has never done any automated testing before, I can't see any reason why not to be using tests as a tool to further your own learning. I learned Go last year relying heavily on tests, first specifying what I wanted to achieve in a high level test, then learning as I figured out how to make the test pass.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#55

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 like grouping by functionality. All the account-related code in one directory, all the order-related code in another, etc.

Bugs me to have the order logic spread out in the views, models, controllers, hepers, libs, etc folders.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#56

Kind of surprised how in depth the tutorial goes, but only manages to mention the word "test" once and doesn't cover the fantastic testing back end included with the AngularJS seed ( https://github.com/angular/angular-seed ). Unless the person learning AngularJS has never done any automated testing before, I can't see any reason why not to be using tests as a tool to further your own learning. I learned Go last year…

Believe me, a big testing section is on the way.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#57
Looks good, and useful to me, nice work.

Will you be covering security in any detail? Most people seem to miss this and I'm discouraged to see when I download the MEAN project this is based on it has serious security flaws.

For example, if you view the articles list at /#!/articles and make a note of any article ID, then visit /article/ it will return the article author's hashed password, salt and email address in addition to the article content. This also works while logged out. Kinda scary if people are using this as a template for their own apps.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#58
post #57

Looks good, and useful to me, nice work. Will you be covering security in any detail? Most people seem to miss this and I'm discouraged to see when I download the MEAN project this is based on it has serious security flaws. For example, if you view the articles list at /#!/articles and make a note of any article ID, then visit /article/ it will return the article author's hashed password, salt and email address in ad…

Yeah that freaked me out too. I'm not super familiar with mongoose either so at the time I couldn't figure out how to leave them out of serialization always. I could do it for one-off calls but there should be a way to generally whitelist I'd think.

Re: AngularJS Tutorial: Learn to Build Modern Web Apps

#60
post #57

Looks good, and useful to me, nice work. Will you be covering security in any detail? Most people seem to miss this and I'm discouraged to see when I download the MEAN project this is based on it has serious security flaws. For example, if you view the articles list at /#!/articles and make a note of any article ID, then visit /article/ it will return the article author's hashed password, salt and email address in ad…

That was one of the first things I noticed when examining the MEAN stack. The final version of the tutorial will take care of this flaw.
Post reply on HN