Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danramteke/mywebsiteissoold-angular
https://github.com/danramteke/mywebsiteissoold-angular
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/danramteke/mywebsiteissoold-angular
- Owner: danramteke
- Created: 2013-02-09T04:39:03.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-11T00:22:10.000Z (almost 12 years ago)
- Last Synced: 2023-03-11T02:34:05.074Z (almost 2 years ago)
- Language: JavaScript
- Size: 227 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
mywebsiteissoold-angular
========================Sample app to show off angular and testing.
$ python -m SimpleHTTPServer
goto localhost:8000 in $BROWSER, or localhost:8000/jasmine.html for tests
I packaged things by feature instead of by layer, mostly to show off dependencies in Angular. There's two features: Loading shuffled tweets, and displaying them. When the app loads up, it asks the FetchTweetsService to load some shuffled tweets into the TweetStore.
Display
=======
I took the liberty of including the templating for the app directly in index.hml because it's so small. There's a controller that keeps track of an index. It's a thin wrapper around the TweetStore, which is itself a thin wrapper around an array of tweets.Notice the spec for the Controller injects a real non-mock version of the TweetStore, but then uses mock tweets.
Retrieve
========Usually, this would be hitting a real service and pass params and such. But a static file of JSON will do for this example. Notice how the Service is injected with $http but stubbing happens on the $httpBackend that Angular provides.