I am working on a small AngularJS application with with Material Steppers.
I have to select items from two sections of the page and return true
only if<
At the top of your application you are declaring:
this.isTriggerA = true;
this.isTriggerB = true;
That means that the default value for both is true, so if both your if conditions:
if (parseInt(this.clickedStepNumber, 10) === 1)
And
if (parseInt(this.clickedStepNumber, 10) === 2)
Are false, the last statement this.isTriggerA === true && this.isTriggerB === true
will always be true.
To do not execute this by default, set isTriggerA
and isTriggerB
to false at the beginning of your code
Since your condition is:
I have to select items from two sections of the page and return true only if the items from both sections belong to the category with id (categoryID) 1.
There is no sense in to keeping those 2 values as true by default