0

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?

0

2 Answers 2

1

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?

1
  • And, in three to five years, which will still be around and not disavowed? ionic2 or html/css/javascript. Commented Feb 9, 2017 at 13:28
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.