i will create a shopping app using ionic 2
, in products details i've created a stepper for increment and decrement value of quantity.
My question : how i can get the input value within ionic 2
in my Component ?
i will create a shopping app using ionic 2
, in products details i've created a stepper for increment and decrement value of quantity.
My question : how i can get the input value within ionic 2
in my Component ?
Solution:
1-
app/pages/index.html
In Angular 2, you should use
ngModel
in the template.2-
app/pages/index.ts
Or as an alternative solution you may use the more appropriate
Form
controls designed for angular 2. (learn more here )Example:
Typescript
Template