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:

  1. I use Ionic2 just for its feature of cross-platform only
  2. 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?

share|improve this question
up vote 1 down vote accepted

If I use ionic2 specific feature, my code 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.

That's always the tradeoff. You have to decide if the benefits you get from doing it in iconic 2 are worth the cost of your developers learning iconic 2.

Thought experiment: would we be even writing web pages at all unless we decided to learn html+ javascript+css?

share|improve this answer
  • And, in three to five years, which will still be around and not disavowed? ionic2 or html/css/javascript. – Rob Feb 9 '17 at 13:28

Sometimes the choice won't be only based on the benefits.

If you are the only developer working on the project and you have the freedom of choice, I would suggest you to be pragmatic. Choose the one you are more comfortable with.

That being said, and focused on the present, thinking about possible web designers maintaining the app is to make assumptions that might not happen. Again I assume you are working solo.

If you aren't, would be good to sit with the team to look for consensus about what to do. At least sit with the developers.

Whether you use ionic2 or html/css/js, try to be disciplined too. For the sake of the coherence and readability of the project. Don't mix both indiscriminately.

Note: If by any reason you badly need to mix both, It's ok. The walkarounds happen. Just add a comment explaining the cause

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.