Last active
December 30, 2015 00:29
-
-
Save mrzmyr/7749827 to your computer and use it in GitHub Desktop.
Share directives for google plus, facebook and twitter incl. popup service.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a | |
href="javascript:void(0)" | |
facebook-share | |
app-id="{{ appId }}" | |
image="{{ image }}" | |
url="{{ url }}" | |
title="{{ title }}" | |
description="{{ description }}" | |
> | |
Share with Facebook | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.service('PopupService', [function () { | |
this.open = function (url, title, options) { | |
var queryArr = []; | |
options = options || {}; | |
options = angular.extend({ | |
width: 550, | |
height: 300, | |
resizable: 1 | |
}, options); | |
options.left = (screen.width / 2) - (options.width / 2); | |
options.top = (screen.height / 2) - (options.height / 2); | |
for(var key in options) { | |
queryArr.push(key + '=' + options[key]); | |
} | |
window.open(url, title, queryArr.join(',')); | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment