1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-01 23:29:23 +01:00

33 lines
807 B
Plaintext
Raw Normal View History

/* global twitterFetcher */
/**
* This directive will allow show latest tweet.
* Usage: <twitter profile="{{twitterName}}"/>
*/
Application.Directives.directive('twitter', [ function () {
return ({
restrict: 'E',
scope: {
profile: '@'
},
2020-01-22 12:24:45 +01:00
templateUrl: '<%= asset_path "home/twitter.html" %>',
link ($scope, element, attributes) {
const configProfile = {
'profile': { 'screenName': $scope.profile },
'domId': 'twitter',
'maxTweets': 1,
'enableLinks': true,
'showUser': false,
'showTime': true,
'showImages': false,
'showRetweet': true,
'showInteraction': false,
'lang': Fablab.locale
};
if ($scope.profile) {
twitterFetcher.fetch(configProfile);
}
}
});
}]);