Suppose I am using ionic2 to create hybrid apps, and it is common that I can finish a job by either using features of ionic2+angular or just html+ javascript+css only, for example, click to disable a button:
html+ javascript+css only solution:
<div id="myDiv" onclick="(
function(){
document.getElementById('myDiv').style.display='none';
}
)()">myDiv</div>
ionic2/angular feature solution:
<div [disabled]="isDisabled" (click)="myFunction();">myDiv</div>
in ts:
myFunction(){
this.isDisabled=true;
}
So my question is, if a job can be done by either using features of ionic2+angular or just html+ javascript+css only, which one should I choose?
I know somebody may ask: If you use Ionic2 but not use its features, why do you use Ionic2? But my idea is simple:
- I use Ionic2 just for its feature of cross-platform only
- If I use Ionic2 specific feature, my codes can be maintained by the one who knows about Ionic2 only, but if I just use HTML+JavaScript+CSS only, my codes can also be maintained by common web designers.
Is my main idea correct?