i want run method after lifecycle angular for example : for change font used as cufon . i want after click on button and call ng-click="addHandler()" statement Cufon.replace('h1', { onBeforeReplace: Bifon.convert }); called? do you Solution? tanks
Here is my code :
after ngclick impossible for example:
$scope.text = "این یک تست است";
$scope.AddHandler = function () {
$scope.text = "تست تست";
Cufon.replace('h1', { onBeforeReplace: Bifon.convert });
};
<h1> {{text}}</h1>
<button ng-click="AddHandler()">Add</button>
You can do it with a directive :
And in your markup :
To change the style with a button, just put the code of the directive inside a function published in the scope (scope.changeStyle....)