In my app, there are a few Angular UI-router states where I use ng-show to display different views in the same state. For instance, the signup state is two steps. So after they’ve created their account information, they’re next asked for address information.
Using a scope variable called
state, I manipulate properties of the state to switch different views on and off. As an extra step, I even added $scope.$digest() after the $scope.state update. But I’m still noticing that the DOM update is noticeably slower on native iOS than in Ionic View or iOS Simulator.
I’ve read that
ng-if performs slightly better but it also destroys the data after ui-router state transition, which I do not want.
My question is would using
ng-class perform any better than
ng-show? As I understand it, the two are not so different in terms of their procedure. They both listen on scope variables for a valid condition and add/remove a class accordingly.
If there is no worthwhile distinction between these two approaches, would anyone be able to recommend a different solution?