is not a function in polymer issue

7 views
Skip to first unread message

avix...@gmail.com

unread,
May 10, 2018, 1:39:06 AM5/10/18
to Polymer

I am using polymer framework for my project in which i'm declaring a function callback in properties and trying to call it from another function showTargetColorDialog() .But on accessing it i'm getting an error

Uncaught TypeError: this.callback is not a function

Please have a look into this.

Polymer({
  is: "parent-dom",
  properties: {
    people: {
      type: String,
      value: "df"
    },
    item: {
      type: String,
      value: "asdf",
      notify: true
    },
    callback: {
      type: Object,
      value: function(index) {
        console.log("Inside  callback function");
      }
    },

  },
  showTargetColorDialog: function(e) {
    this.callback("sadf");
  }
});
Reply all
Reply to author
Forward
0 new messages