polyfills

Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'

痴心易碎 提交于 2019-12-10 18:20:23
问题 I want to implement polyfill Object.setPrototypeOf as is descrbed in: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf It is my polyfill.ts: // Only works in Chrome and FireFox, does not work in IE: Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) { obj.__proto__ = proto; return obj; } polyfills.d.ts: declare interface ObjectConstructor{ setPrototypeOf(obj: any, proto: any); } I was trying with many possibilities of

IE 8 Canvas using excanvas polyfill: no errors, but animation is not running on IE 8

ぐ巨炮叔叔 提交于 2019-12-10 16:34:32
问题 I have an animation using canvas that is working fine in Chrome. I am using the excanvas polyfill for IE 8 support. I attached excanvas using an IE conditional tag in the head, as per the excanvas instructions. Working page here | Full code on Github The simplified HTML: <head> <meta charset="utf-8"> <!--[if gte IE 9]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]--> <!--[if lt IE 9]><meta http-equiv="X-UA-Compatible" content="IE=7" /><![endif]--> <link rel=

Are there any polyfills for display: table, table-row, table-cell etc

寵の児 提交于 2019-12-10 15:08:06
问题 I'm realizing that, for a lot of purposes, display: table and likewise table-row, table-cell and so forth have very useful positioning properties, and can be used instead of floats for a lot of purposes, such as for making floatless menus, and better aligned footers. However, the lack of support is a real deterrent. I'd like to know what options are there for polyfills to emulate display: table, table-cell, table-row etc? 回答1: The support for table-row , for instance, is actually pretty good.

System js syntax error, IE11

為{幸葍}努か 提交于 2019-12-10 12:55:22
问题 I've got an angular 2 app working inside firefox and chrome, not so much inside (sigh) IE. Based on my stack trace, it looks like there is a problem with my System js setup. Here is the error description that I see inside my web console. Error: (SystemJS) Syntax error SyntaxError: Syntax error at ZoneDelegate.prototype.invoke (http://localhost:8050/node_modules/zone.js/dist/zone.js:230:13) at Zone.prototype.run (http://localhost:8050/node_modules/zone.js/dist/zone.js:114:17) at Anonymous

Why is ES7/array polyfill needed despite the tsconfig target is set to ES5

眉间皱痕 提交于 2019-12-10 10:14:28
问题 I have the following settings in the tsconfig.json . I added "es2017" to use Array.includes .: { "compilerOptions": { "lib": [ "es6", "es2017", "dom" ], "module": "es6", "target": "es5" } } Now, I realized, that I have to add import 'core-js/es7/array'; to the polyfills.ts , to use Array.includes also for the Internet Explorer 11. The target in the tsconfig.json is set to es5 , which does not have Array.includes . Why do I need to add the polyfill? 回答1: TypeScript does not auto-polyfill code.

TS2304: cannot find name require and process

本小妞迷上赌 提交于 2019-12-10 01:08:35
问题 When I want to start my angular 2 app using "npm start". I get errors: I tried a lot of "solutions" from internet, but nothing works. My versions: npm - 4.1.2 typings - 2.1.0 node - 7.5.0 tsconfig.json { "compilerOptions": { "target": "es6", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es2015", "dom"], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true } } polyfills.ts import 'core-js

RequireJS: Conditionally Load Polyfill Using Modernizr

久未见 提交于 2019-12-10 00:16:26
问题 How do you wrap a polyfill script as an AMD module and conditionally load it using Modernizr and RequireJS? (Figured it out while I was drafting my question - posting answer for anyone else trying to do the same thing.) 回答1: The polyfill I needed to load was jquery-placeholder for browsers that don't support input placeholders. It does not provide AMD support out of the box. First I wrapped it as an AMD module like this: define(['jquery'], function ($) { (function(window, document, $) { ...

AngularJS Decorator without object.defineProperty

安稳与你 提交于 2019-12-08 10:23:19
问题 How do I use decorators without having access to object.defineProperty? I am looking into the shims available: es5-sham polyfill but in case those don't pass testing, is there another way decorators were intended to work? I am using the decorator for $onRootScope. I am using angular 1.08. I need compatibility with IE7. Update I have tried out a few methods that seem to work but I don't know the difference between them: plunkr var app = angular.module('plunker', []); app.config(['$provide',

position sticky polyfill with overflow support [duplicate]

ぃ、小莉子 提交于 2019-12-08 03:34:56
问题 This question already has answers here : Why does `overflow:hidden` prevent `position:sticky` from working? (4 answers) Closed last year . I am using position: sticky in my app, inside a container who use an overflow property to show a scrollbar. I have searched for a polyfill who does support this condition, but without any luck so far. Does anyone know such a polyfill/shim who support oveflow ? Regards 回答1: I used a position: sticky polyfill called stickyfill to do this. You just have to

position sticky polyfill with overflow support [duplicate]

与世无争的帅哥 提交于 2019-12-07 16:14:29
This question already has answers here : Why does `overflow:hidden` prevent `position:sticky` from working? (4 answers) Closed last year . I am using position: sticky in my app, inside a container who use an overflow property to show a scrollbar. I have searched for a polyfill who does support this condition, but without any luck so far. Does anyone know such a polyfill/shim who support oveflow ? Regards I used a position: sticky polyfill called stickyfill to do this. You just have to tell the polyfill to do it's job even on browsers that support position: sticky natively. Here's a demo, also