angular2$rootScope
で 、およびvalueを使用したい。$root
また、以下のように angular2 で angularjs ディレクティブを変換する方法を混乱させます。
.directive('thisDirective', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on('click', function(evt){
var getMethods = {
get_link:function(){
var observer = {
override:true,
triggerIndex:0,
onLink:function(link){
scope.$root.getThisVal = false;
(scope.$$phase || scope.$digest());}
};
scope.$root.bitlyUrl = "";
scope.$root.modelFlags.share_window = scope.$root.modelFlags.steps_upload = scope.$root.getThisVal = true; $('.addthisbtn[datatitle=Email]').trigger('click',observer )
},
addthis_button:function(){
var observer = {
override:true,
triggerIndex:0
};
$('.addthis-btn[data-title=Email]').trigger('click',observer )
}
};
getMethods[attrs['thisDirective']]();
});
}
};
})