There are a few simple libraries to make Angular work with Sweetalert. If you really want to check them out:
Unfortunately, they wern't that "Sweet". The idea is to not use libraries to use other libraries.
There are a few simple libraries to make Angular work with Sweetalert. If you really want to check them out:
Unfortunately, they wern't that "Sweet". The idea is to not use libraries to use other libraries.
var app = angular.module('myApp', []); | |
/* Set up a simple controller with a few | |
* examples of common actions a controller function | |
* might set up on a $scope. */ | |
app.controller('MainCtrl', function($scope, someService) { | |
//set some properties | |
$scope.foo = 'foo'; | |
$scope.bar = 'bar'; |
angular.module('stateMock',[]); | |
angular.module('stateMock').service("$state", function($q){ | |
this.expectedTransitions = []; | |
this.transitionTo = function(stateName){ | |
if(this.expectedTransitions.length > 0){ | |
var expectedState = this.expectedTransitions.shift(); | |
if(expectedState !== stateName){ | |
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName ); | |
} | |
}else{ |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
This gist assumes: