Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10022

How declare a static method?

$
0
0

Hi,

 

I was wondering for classes that extend Class: sap.ui.base.Object, how do you declare static methods?

For example, given the Dog class definition below, how would I add a static method getStaticBark() ?

 

I would like to call the static method as follows: my.Dog.getStaticBark();

 

///////////////////////////////////////////////////////////

//Dog Class Definition

sap.ui.base.Object.extend('my.Dog', {

  getBark: function () {

  return "bark";

  },

 

});//end class

 

thanks for any help.

 

regards,

Phong


Viewing all articles
Browse latest Browse all 10022

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>