News for hackers. Stuff that matters.
Re:AngularJS: an Overview by skarmklart on Sunday July 07, 2013 @04:46AM (#6001505)
One thing that really impressed me is how Angular does dependency injection, seemingly through magic.

This blog explains more: http://www.alexrothenberg.com/2013/02/11/the-magic-behind-an...

Re:AngularJS: an Overview by e12e on Sunday July 07, 2013 @09:19AM (#6001935)
Great link on AngularJS injection. Unfortunately the code shown is also an example of the kind of thing that makes me less-than enthusiastic about a lot of the blogs I see on web apps. Right at the top (of the code) we have:

   <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script>
When https would have worked just fine. Instead, because it's referenced with http, we're basically saying - insert some random code in our page, if there's anyone that can spoof packets.

It's like Microsoft Office Macros all over again -- only much worse.

Later he calls the github api over https -- but (and this is a genuine question, I don't know) -- what would happen if github redirected from https to http? Would it fail, or would we get random insecure data import?:

    $http.get('https://api.github.com/repos/angular/angular.js/commits')
(Now, redirecting to http would obviously be, well, bad form at least -- but conceivable to stave off slashdotting by an overworked sysadmin, perhaps?).