[ 2 posts ]

bluelionet

  • Joined: Wed Apr 11, 2012 2:09 am
  • Posts: 1
  • Offline
  • Profile
Tags:

Problem using 'oop' module directly

Post Posted: Thu Apr 26, 2012 10:36 pm
+0-
Hi,

I encountered some problem using oop module's augment() function.
Here is the code:
Code:
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script>
<script type="text/javascript">

YUI().use('oop', function(Y){
    function Robot(){
    }
    Y.augment(Robot, Y.EventTarget);
});

</script>

Running this will prompt an error saying "k is undefined".

However, if I used node module instead to implicitly include the oop module, it worked.
Code:
YUI().use('node', function(Y){
    function Robot(){
    }
    Y.augment(Robot, Y.EventTarget);
});


Is there anything to notice while using oop module directly?
Thanks!

Jeff Pihach

YUI Contributor

  • Username: hatch
  • Joined: Wed Dec 08, 2010 9:20 am
  • Posts: 37
  • Twitter: fromanegg
  • GitHub: hatched
  • Gists: hatched
  • IRC: hatch
  • Offline
  • Profile

Re: Problem using 'oop' module directly

Post Posted: Fri Apr 27, 2012 4:23 am
+0-
Hello,

the 'oop' module only requires yui-base and oop, but to use Y.EventTarget you need event-custom-base which is loaded in with node.

You can see which module the supplied methods are in in the API http://yuilibrary.com/yui/docs/api/ and you can also see which modules are required by using the configurator http://yuilibrary.com/yui/configurator/.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum