title: Exception in delivering result of invoking : TypeError: is not a function in meteor
body: <p>When I added in onSuccessCreateClass into meteor.call callback and this error come up. dont know what is wrong here?    </p>
  
  <blockquote>
    <p>Exception in delivering result of invoking 'createClass': TypeError:
    this.onSuccessCreateClass is not a function
        at <a href="http://localhost:3000/app/client/components/MyClasses.jsx?044c7b228d4b33fcea4b9f3c05da6d82e5e6c8b7:37:11" rel="nofollow">http://localhost:3000/app/client/components/MyClasses.jsx?044c7b228d4b33fcea4b9f3c05da6d82e5e6c8b7:37:11</a>
        at null._callback (<a href="http://localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:999:22" rel="nofollow">http://localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:999:22</a>)
        at _.extend._maybeInvokeCallback (<a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3500:12" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3500:12</a>)
        at <em>.extend.dataVisible (<a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3529:10" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3529:10</a>)
        at <a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4365:7" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4365:7</a>
        at Array.forEach (native)
        at Function.</em>.each._.forEach (<a href="http://localhost:3000/packages/underscore.js?46eaedbdeb6e71c82af1b16f51c7da4127d6f285:149:11" rel="nofollow">http://localhost:3000/packages/underscore.js?46eaedbdeb6e71c82af1b16f51c7da4127d6f285:149:11</a>)
        at _.extend._runAfterUpdateCallbacks (<a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4364:7" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4364:7</a>)
        at _.extend._livedata_data (<a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4354:10" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4354:10</a>)
        at onMessage (<a href="http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3361:12" rel="nofollow">http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3361:12</a>)</p>
  </blockquote>
  
  <pre><code>onSuccessCreateClass() {
      console.log("Successfully created New Class")
      $("#createClassModal").modal('hide')
      $('#createClassModal').on('hidden.bs.modal', function () {
          $(this).find('form').trigger('reset')
      })
  },
  
  onPressSubmit(e) {
      e.preventDefault()
      const className = e.target.cname.value
      console.log(this.props.courseId)
      console.log(className)
      if (Meteor.user().classes.length !== 0)
      {
          console.log("Got Class")
          Meteor.call("createClass", this.props.courseId, className, function(error) {
              if (error)
              {
                  console.log(error.reason)
              }
              else
              {
                  this.onSuccessCreateClass()
              }
          })
      }
      else
      {
          console.log("No Class")
          Meteor.call("createNewClass", this.props.courseId, className, function(error) {
              if (error)
              {
                  console.log(error.reason)
              }
              else
              {
                  this.onSuccessCreateClass()
              }
          })
      }
  },
  </code></pre>