Git Product home page Git Product logo

Comments (4)

rajeshwarpatlolla avatar rajeshwarpatlolla commented on June 29, 2024

It depends on the callback function you are passing in the object. Can you show me your code?

from ionic-timepicker.

lf94 avatar lf94 commented on June 29, 2024
 $scope.timepickerSettings1 = {
    format: 12,
    step: 1,
    callback: function(val) {
      if (typeof (val) === 'undefined') {
      } else {
        var selectedTime = new Date(val * 1000);
        $scope.parkingSpace.availableFrom = selectedTime.getUTCHours()+":"+selectedTime.getUTCMinutes();
        $scope.parkingSpace.from = val;
      }
    }
  };

  $scope.timepickerSettings2 = {
    format: 12,
    step: 1,
    callback: function(val) {
      if (typeof (val) === 'undefined') {
      } else {
        var selectedTime = new Date(val * 1000);
        $scope.parkingSpace.availableTo = selectedTime.getUTCHours()+":"+selectedTime.getUTCMinutes();
        $scope.parkingSpace.to = val;
      }
    }
  };

In my template:

 <div class="col">
        <ionic-timepicker input-obj="timepickerSettings1">
        <button class="button button-block button-positive overflowShow">
          <i class="icon ion-clock"></i> Available from <span>{{parkingSpace.availableFrom}}</span>
        </button>
        </ionic-timepicker>
      </div>
      <div class="col">
        <ionic-timepicker input-obj="timepickerSettings2">
        <button class="button button-block button-positive">
          <i class="icon ion-ios-arrow-thin-right"></i> Until <span>{{parkingSpace.availableTo}}</span>
        </button>
        </ionic-timepicker>
      </div>

No matter what button I press, the first one is the only one that changes. It's really bizarre.

from ionic-timepicker.

rajeshwarpatlolla avatar rajeshwarpatlolla commented on June 29, 2024

It should not happen. You can check the demo link i mentioned in the repo. There i am using two components. But the callbacks are working fine. Print a console and check it, where the control is entering.

from ionic-timepicker.

lf94 avatar lf94 commented on June 29, 2024

Yeah I have printed to console to see if the second one is being called, and it isn't. I just checked your example though and I do see it working there, so I'm baffled. I'll close this issue since it's clear that you can have two timepickers. Maybe the surrounding markup is causing issues in Angular or something.

from ionic-timepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.