It is not possible to disable an a
element.
According to http://www.w3.org/TR/html5/disabled-elements.html:
4.13 Disabled elements
An element is considered disabled if it falls into one of these categories:
- Button elements that are disabled
- Input elements that are disabled
- Select elements that are disabled
- Textarea elements that are disabled
- Optgroup elements with a disabled attribute
- Option elements that are disabled
- Fieldset elements with a disabled attribute
Most likely, you'll need to change the a
element to a button
and style it to appear like a link.
Here is a link to a fiddle demonstrating this: http://jsfiddle.net/simpulton/q8r4e/
Note that the fiddle does not belong to me, I found it through a search.
If you are using bootstrap, you can disable a button using the following code:
<button type="button" ng-click="pageChange('first')" ng-disabled="first" class="btn btn-link">First</button>
If you simply want to prevent a function from executing in the view:
<a href="" ng-click="!first && pageChange('first')">