Questions tagged [google-closure]

Google Closure is a framework for writing large-scale applications in JavaScript. It includes an extensive library, a linter, a compiler, a template system, and a stylesheet language.

Google Closure is a framework for writing large-scale applications in JavaScript. It includes an extensive library, a linter, a compiler, a template system, and a stylesheet language.

Closure is an Object-Oriented framework which borrows many concepts from Java, such as support for strong typing for compile-time checking, and deep object inheritance hierarchies.

532 questions
10
votes
4 answers

Refused to get unsafe header "Location"

I have a website and my REST api server. I do ajax post request to the REST server to create new model. Answer for this request will be "HTTP/1.1 201 Created" response with header "Location: http://myapi.com/some/path/111" But I get error message…
Eugene Manuilov
  • 4,271
  • 8
  • 32
  • 48
10
votes
2 answers

How To: Closure Template for generating HTML in which attribute value of an element contains curly braces

How do I get following HTML created using closure template?
IsmailS
  • 10,797
  • 21
  • 82
  • 134
10
votes
4 answers

Integrating Google Closure Compiler with MS Build on a build server

I'm looking into ways of minifying javascript files as part of our CI process, so that we can use the un-minified files in development and have them automatically compressed when deployed to staging and live servers. This is for an ASP.NET site; we…
10
votes
2 answers

How do I get the Closure Compiler to stop complaining about union types when calling a function?

I'm seeing this in particular when using the jQuery-1.4.3 externs file. The javadocs for that reads /** * @param {(string|number|function(number,number))=} arg1 * @return {(number|jQueryObject)} * @nosideeffects */ jQueryObject.prototype.width…
9
votes
3 answers

Creating events with google closure

I would like to use events to communicate between my objects in a google closure (GC) environment. Suppose I have two classes foobar.Boss and foobar.Employee. The Boss wants to know when the Employee has made coffee, and whether or not that coffee…
Ben Flynn
  • 18,524
  • 20
  • 97
  • 142
9
votes
2 answers

getting started with Google Closure if you don't care about minifying/compiling?

If you don't care about minifying your code, is there a way to get started using the Google Closure library without having to set up a subversion client and use the compiler? The Notepad sample program on Google's website refers to
Tim
  • 429
  • 6
  • 19
9
votes
2 answers

Is Google starting to use Dart? Did they build a Closure (or GWT) to Dart compiler?

We are trying to decide if to use Dart for building a web app. We are looking for a technology that will stay highly relevant roughly for the next 5 years. Now that EcmaScript 6 specs are around the corner (should be out by the end of 2014) we can't…
Durden81
  • 966
  • 9
  • 25
9
votes
2 answers

What is DomHelper in google closure?

Could somebody explain what is the meaning of DomHelper in google closure? What is it for and how it may be useful? Thanks! edit: Here is a more detailed answer
Evgeny
  • 10,698
  • 9
  • 60
  • 70
9
votes
3 answers

how to hide/show dom element in google closure

domA.style.display = "none"; domA.style.display = "block; I could not find such functions in the library, but I guess they must have it somewhere.
romerun
  • 2,161
  • 3
  • 18
  • 25
9
votes
2 answers

Why am I missing soyDocs for my soy template?

Plovr is raises a compile-time exception when I try to compile this soy template. // Copyright 2012 David Faux /** * @overview Lays out the home page. */ {namespace templates.home} /* * Lays out the home page. */ {template .main}

Hi!…

dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
8
votes
3 answers

WARNING - dangerous use of the global this object

In Google Closure Compiler I get the warning WARNING - dangerous use of the global this object Here is an example. The error line and offset refers to the beginning of the word this function aToggle() { if(shown) toggle.show() else …
700 Software
  • 85,281
  • 83
  • 234
  • 341
8
votes
3 answers

How do I use Google Closure compiler to remove unused JavaScript code?

How do I use Google Closure compiler to remove unused code? I am using the JQuery Slider control but am not using anything else within JQuery. So I read that Google Closure compiler in Advanced mode can remove unused code, but I don't know how. I…
TeddyR
  • 1,213
  • 3
  • 12
  • 13
8
votes
2 answers

Connecting to ClojureScript bREPL: clojure.browser.repl/connect throws TypeError in compiled JavaScript

I'm trying to connect to a ClojureScript browser REPL, and I'm having trouble with clojure.browser.repl/connect. My compiled JavaScript throws a TypeError trying to call appendChild on a null object in the block of Google Closure code at the top.…
8
votes
1 answer

Why does Google Closure swap arguments?

I've seen the Google Closure compiler do a lot of rewriting in if-clauses. For example: if (a === 3) {…} turns to if (3 === a) {…} Are comparisons faster in JavaScript, if the primitive is the first argument, or what is the reason for this?
mritz_p
  • 3,008
  • 3
  • 28
  • 40
7
votes
3 answers

Using Google Closure's @typedef tag

Google's Closure compiler has an "@typedef" tag, but is it OK to use them in your code? (I know it'll work, but is it frowned upon?) So here's my type /** * The plan object's typedef * @typedef {Object} */ Types.Plan = { "style":…
Jelle De Loecker
  • 20,999
  • 27
  • 100
  • 142
1 2
3
35 36