TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A post-mortem on my first AngularJS project

81 pointsby JohnMunschover 11 years ago
If you're tired of To-Do lists and Twitter feed examples for AngularJS I can offer a variation. This is a project I did for a t-shirt site and it does quotes using a variety of variables in real time as the user interacts with the UI. I also show how I went back to the existing project to learn how to add unit testing with Karma and Jasmine and a unit testing coverage report with Istanbul. Spoiler: It was pretty easy.

4 comments

jarnixover 11 years ago
Post mortem means that your project is dead...
评论 #6429937 未加载
评论 #6431289 未加载
评论 #6430994 未加载
mdkessover 11 years ago
Nice writeup, I especially appreciate the focus on testing. End product looks really slick. You might want to add a screenshot and a link to the blog post in the GitHub repo that you posted.<p>One thing that I think could be improved is the layout of your code. Right now you have a single controller that handles everything. For example, selecting a shirt color should be a directive, and so should the quantity picker. Then use the $scope.$emit and $scope.$on to hook events together. This way, if I make a better color picker (although yours is pretty stylish), I can swap out yours for mine so long as I emit the same events as yours.<p>This would also make it easier to add new directives - for example, maybe I could choose a decal on the front and back of shirts, or jersey numbers or something. So I think that the controllers in this case should be pretty minimal, and just provide a scope to tie the various directives together.<p>Anyway, just a thought. Thanks for sharing this and the included GitHub repo.
评论 #6430595 未加载
welderover 11 years ago
I was hoping this would cover:<p>1. Angular.js vs Backbone.js from experience of their differences<p>2. Angular.js with Require.js (I already know about Backbone.js AMD architecture)<p>Has anyone done a large project in both Backbone.js and Angular.js?
评论 #6429972 未加载
评论 #6430373 未加载
评论 #6429635 未加载
obilgicover 11 years ago
Where did you get those sticker on your laptop?
评论 #6429945 未加载
评论 #6429626 未加载