Bawn
Bawn

Reputation: 509

Backbone Calling A function in a View

I have a function, which I would I like to call and pass a variable from another function. The function being called then returns a variable. I am unsure as to how to complete this task. I have attempted a varying number of ways but none with any success. Here is the sample code:

  md5: function  ( str ) {

 return String

}

I want to call this md5 function from inside this function:

saveTeacher: function(e) {

}

How would I achieve this ?

Upvotes: 0

Views: 76

Answers (1)

akshaykumar6
akshaykumar6

Reputation: 2257

Use this, it should work.

saveTeacher: function(e) {
  this.md5(str);
}

Upvotes: 8

Related Questions