How OAuth 2.0 works in real life. I was driving by Olaf's bakery...
== vs. === in JavaScript: Equal vs. Kinda Sorta Equal
A common explanation is that triple equals is more “strict” than double equal.
But that doesn’t tell you the whole story, it’s actually simpler and also more complicated than that.
AngularJS: Difference between Service vs Provider vs Factory
If you are searching for this it’s probably because you are trying to figure out which one is the right one for you to use. Or because you’ve come across the three of them and are trying to determine the difference because they seem similar.
If you think they are similar – you’re right. They are very similar. In fact, they are all the the same thing.
They are all providers. The factory and the service are just special cases of the provider, but you can accomplish everything you want using just provider. I’ll show you.
AngularJS Game Programming: Making Minesweeper
In this blog posts series I’m going to show you how to create the minesweeper game using AngularJS. If you’re not familiar with minesweeper the goal of the game is uncover all the safe spots in a minefield without triggering a mine. Sometimes you uncover numbers which hint to where the mines are.
AngularJS: Getting around ngApp limitations with ngModule
As you AngularJS application gets more complex you will likely come to discover that the ngApp directive has two fairly big limitations:
- You can only have one
ng-app
per page. - You can only associate a single module with a single HTML element
AngularJS – See how it all connects
Hover over the code to see how it all connects.
There are a lot of parts to Angular. When you are first learning it it can be very overwhelming. To help I created this small learning tool to let you see how different parts connect.
The way it works is simple simply move your mouse over an Angular element anywhere you see it and it will highlight it everywhere else. Visually showing you how it’s all connected.
The sample code simply counts the number of times you click a button. It’s a simple app that illustrated some of the commonly used components of angular:
- Contains the necessary part “ng-app” directive
- The very useful controller
- Data binding to a variable
- Binding to a function
Go ahead over over these bullets or the code and see what I mean. Let me know what you think in the comments below.
You can play around with a working version of this code using this JS Fiddle: http://jsfiddle.net/luisperezphd/JTU67/.
angular.module("MyModule", [])
.controller("MyController", function($scope) {
$scope.clickCount = 0;
$scope.userClick = function() {
$scope.clickCount++;
};
});
HTML
<!DOCTYPE html> <html ng-app="MyModule"> <head> <script src="angular.min.js"></script> <script src="myscript.js"></script> </head> <body><div ng-controller="MyController"> You clicked the button {{clickCount}} times.<br/> <button ng-click="userClick()">Click me!</button> </div></body> </html>
- 1
- 2
- 3
- …
- 5
- Next Page»