Domanda

I am learning how to make a menu bar using Google Closure libraries via this example.

http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/menubar.html

However, when I try out the code in my own application, the Plovr compiler complains that no file provides goog.ui.menuBar. Is goog.ui.menuBar part of the Closure library or is there a plugin/extension that I must download to use it?

È stato utile?

Soluzione

The copy of Closure Library embedded in the February 8, 2012 release of plovr [hg revision 4b3caf2b7d84] uses Closure Library revision 1559, which is dated February 2, 2012.

The menubar widget was introduced in Closure Library revision 1947, dated June 4, 2012. Fortunately, you can download the latest version of the Closure Library and have plovr use the latest copy as follows:

plovr_config.json

{
  "id": "myapp",
  "inputs": [
    "/home/my_project/js/myapp.js"
  ],
  "closure-library": "/path/to/closure-library/closure/goog",
  "mode": "ADVANCED",
  "level": "VERBOSE",
  "output-file": "/home/my_project/build/myapp.compiled.js"
}


Where is goog.ui.menuBar provided?

goog.ui.menuBar is provided in the Closure Library in closure/goog/ui/menubar.js.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top