TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A post-mortem on my first AngularJS project

81 点作者 JohnMunsch超过 11 年前
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 条评论

jarnix超过 11 年前
Post mortem means that your project is dead...
评论 #6429937 未加载
评论 #6431289 未加载
评论 #6430994 未加载
mdkess超过 11 年前
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 未加载
welder超过 11 年前
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 未加载
obilgic超过 11 年前
Where did you get those sticker on your laptop?
评论 #6429945 未加载
评论 #6429626 未加载