Answer the question
In order to leave comments, you need to log in
How to convert directive from AngularJS to Angular 2?
There was a directive:
app.directive( 'vkComments', [
'$window',
'$timeout',
function( $window, $timeout ){
return {
restrict: 'E',
template: '<div id="vk_comments" ng-transclude post-url="{{url}}"></div>',
scope: {
readyToBind: '@'
},
replace: !0,
transclude: !0,
link: function( $scope, $element, $attr){
$scope.$watch( 'readyToBind', function(){
$timeout( function(){
$window.vkComment = VK.Widgets.Comments( 'vk_comments', { limit: 10, attach: '*', autoPublish: 1, mini: 1 }, location.href);
}, 100 );
} );
}
}
}
] );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question