Reputation: 5532
Working through some issues with our code and I'm wondering if the order of the attributes within the element matters when it comes to Angular.
I've seen posts herein SO where for plain HTML it does not matter but is there a difference for Angular related tags and variable referencing?
For example would #inputRefEndDate be before everything else, or would matInput, or would mat need to be before #inputRefDate or DOESN'T MATTER AT ALL?
<input class="form-control cot-date-time"
id="ffEndDate"
#inputRefEndDate
matInput
(keypress)="handleKeyCheck($event.key)"
(keyup)="handleDateUpdates($event)"
/>
Upvotes: 1
Views: 878
Reputation: 9270
You are, in effect, expanding a Class definition with these. Declaring the variables in a class is not affected by order, but there are best practices for maintaining readability.
The short answer is no. This will not affect how your code runs.
The long answer is yes. This affects long term readability, and you should follow a certain pattern and stick with it!
Upvotes: 3