Can you tell me a way to disable the submit button, which changes to a new state by:
Submit
The butto
My take on the directive provided by @m59 (without introducing an isolated scope):
.directive('uiSrefIf', function($compile) {
return {
link: function($scope, $element, $attrs) {
var uiSrefVal = $attrs.uiSrefVal,
uiSrefIf = $attrs.uiSrefIf;
$element.removeAttr('ui-sref-if');
$element.removeAttr('ui-sref-val');
$scope.$watch(
function(){
return $scope.$eval(uiSrefIf);
},
function(bool) {
if (bool) {
$element.attr('ui-sref', uiSrefVal);
} else {
$element.removeAttr('ui-sref');
$element.removeAttr('href');
}
$compile($element)($scope);
}
);
}
};
})