google-closure-library

Bad type annotation. Unknown type

最后都变了- 提交于 2019-12-12 04:58:27
问题 I keep getting the warning mentioned above but can't figure out why. I've added deps.js and deps.js contains a reference to the type. Here is the offending code: goog.provide("MyCompany.MyApp.dom"); MyCompany.MyApp.dom.getArticleAmountInput_=function(){ return document.getElementById("articleAmount"); }; /** * Gets the article amount input value * @type {function(this:MyCompany.MyApp.dom):number} */ MyCompany.MyApp.dom.getArticleAmount=function(){ var tmp=this.getArticleAmountInput_(); return

Wrap google-closure-library variables for angular project

烂漫一生 提交于 2019-12-11 19:17:35
问题 So, following on from this question I now have my module both in bower and npm, I can import it fine to my project and declare it in app.module, even attempt to use it in my controller: index.html: <script src="bower_components/google-closure-library/closure/goog/base.js"></script> app.module.js: angular .module('drugQualityDataManagerApp', [ 'ngStorage', 'ngResource', 'ngCookies', 'ngAria', 'web-gl-earth2', uploadData.controller.js: $scope.initializeMapWebGL = function(){ var earth = new

JSON/JSONP how to use for(;;); in the respose body

你离开我真会死。 提交于 2019-12-11 09:41:09
问题 I can't seem to figure out a way to ignore the for(;;); in the response body of my cross domain JSONP requests. I am doing this on my own servers, nothing else going on here. I am trying to include that for(;;); inside the response body of my callback as such: _callbacks_.callback(for(;;);[jsondata....]); but how can I remove it from the response body before the JS code gets parsed? I am using the Google Closure Library btw. 回答1: Ok I think I figured it out. The reason why the for(;;); is

How do I tell the closure compiler to ignore code?

走远了吗. 提交于 2019-12-11 07:45:29
问题 I decided I needed something to help me a bit while implementing interfaces. So I added this function to the base.js file in the closure library. /** * Throws an error if the contructor does not implement all the methods from * the interface constructor. * * @param {Function} ctor Child class. * @param {Function} interfaceCtor class. */ goog.implements = function (ctor, interfaceCtor) { if (! (ctor && interfaceCtor)) throw "Constructor not supplied, are you missing a require?"; window

Closure Dev Mode & Chrome Packaged App — “document.write() is not available in the sandbox of packaged apps”

折月煮酒 提交于 2019-12-11 04:16:06
问题 I'm running into issues in development mode with Closure as the security policies for my Chrome Packaged App (i.e., v2 manifest file) are restricting things called in the Closure bootstrap process (e.g., when I load the app using the uncompiled dev code, I get "document.write() is not available in the sandbox of packaged apps"). 回答1: The following code is what I eventually used and it works great for running Closure in Dev mode within Chrome's Packaged App framework. In closure/goog/base.js,

“Acecss Denied to content document” error in IE9 with goog.net.IFrameIO

泄露秘密 提交于 2019-12-11 03:56:15
问题 I am trying to use goog.net.IFrameIO to upload a file and get a JSON response from server after uploaded file is processed. It works fine on Chrome and Safari, but does not with work with IE9 where it errors out with "Acecss Denied to content document", then prompts up to save/open the json response. Here is the html code and js code that I have - HTML Code: <form action="/" enctype="multipart/form-data" method="POST" id="upload-form"> <input type="file" name="selected-file" id="selected-file

Google Closure Compiler Includes

穿精又带淫゛_ 提交于 2019-12-11 03:04:55
问题 I've been using google closure compiler for a little bit with my projects, it's awesome! I've been trying to find out whether or not you can do "includes" in a javascript file that includes other javascript files. I'm trying to have 1 javascript file that "includes" all the files I need then compiles, much like you can do with a LESS import statement, ("@import "../less/bootstrap") for example. Is this possible? - Or do you have to provide the list of source files at time of compilation in

SHA512 not the same in CryptoJS and Closure

旧街凉风 提交于 2019-12-10 09:44:44
问题 I have some troubles with a simple crypto-challenge. I want to do following: getting a url-encoded and base64-encoded value do url-decoding do base64-decoding hash with Sha512 When working with CryptoJS, i use following code: var parameter = "Akuwnm2318kwioasdjlnmn"; var urlDecoded = decodeURIComponent(parameter); var base64Decoded = CryptoJS.enc.Base64.parse(urlDecoded); var hashed = CryptoJS.SHA512(base64Decoded).toString(CryptoJS.enc.Base64); //hashed = "UxupkI5+dkhUorQ+K3

dynamic script tag loading is not working as expected

人走茶凉 提交于 2019-12-09 23:25:51
问题 We have an application that uses both the google closure and dojo libraries. We have the following in our index page which works as expected: <script type="text/javascript" src="runtime/src/lib/google-closure-rev26/closure/goog/base.js"></script> <script type="text/javascript" src="runtime/src/lib/dojo_release_132_src/dojo/dojo.js"></script> <script type="text/javascript" src="runtime/src/core/loader.js"></script> We would like to use only one script tag in the actual html source. So we tried

problems creating custom event dispatcher in google closure library

笑着哭i 提交于 2019-12-07 12:01:03
问题 I'm trying to create a custom event dispatcher in google closure js library. I'm basing this code off of the animation class in the fx folder, yet I keep getting this error.. "goog.events is undefined" yet I'm including the events package at the top. here is my code. goog.provide('test.util.Animation'); goog.provide('test.util.Animation.EventType'); goog.provide('test.util.AnimationEvent'); goog.require('goog.events'); goog.require('goog.events.EventTarget'); goog.require('goog.events