es5-shim

Typescript Map throwing error while using its functions (mapobject.keys() is not a function)

一个人想着一个人 提交于 2020-06-24 22:26:25
问题 I am a new bee in typescript , In my angular4 project I am receiving a map object as a json. so I declared a class that is given bellow <importing... required classes here..> export class FormConfig { public id: number; public name: string; public fieldMap :Map<string,Array<Field>>; public fieldList : Array<Field> ; } I am receiving exactly same JSON from api. I consoled the object of FormConfig and I am getting the console without any error. My code got compiled without any warning and error

Typescript Map throwing error while using its functions (mapobject.keys() is not a function)

两盒软妹~` 提交于 2020-06-24 22:26:01
问题 I am a new bee in typescript , In my angular4 project I am receiving a map object as a json. so I declared a class that is given bellow <importing... required classes here..> export class FormConfig { public id: number; public name: string; public fieldMap :Map<string,Array<Field>>; public fieldList : Array<Field> ; } I am receiving exactly same JSON from api. I consoled the object of FormConfig and I am getting the console without any error. My code got compiled without any warning and error

Requirejs why and when to use shim config

≡放荡痞女 提交于 2019-12-27 18:21:14
问题 I read the requirejs document from here API requirejs.config({ shim: { 'backbone': { //These script dependencies should be loaded before loading //backbone.js deps: ['underscore', 'jquery'], //Once loaded, use the global 'Backbone' as the //module value. exports: 'Backbone' }, 'underscore': { exports: '_' }, 'foo': { deps: ['bar'], exports: 'Foo', init: function (bar) { //Using a function allows you to call noConflict for //libraries that support it, and do other cleanup. //However, plugins

Requirejs why and when to use shim config

最后都变了- 提交于 2019-12-27 18:21:06
问题 I read the requirejs document from here API requirejs.config({ shim: { 'backbone': { //These script dependencies should be loaded before loading //backbone.js deps: ['underscore', 'jquery'], //Once loaded, use the global 'Backbone' as the //module value. exports: 'Backbone' }, 'underscore': { exports: '_' }, 'foo': { deps: ['bar'], exports: 'Foo', init: function (bar) { //Using a function allows you to call noConflict for //libraries that support it, and do other cleanup. //However, plugins

date pipe issue on IE10 - 'Intl' is undefined

喜你入骨 提交于 2019-12-23 13:16:29
问题 I have the following simple example that uses the Angular 2 date pipe which works fine in IE11 but fails on IE10: @Component({ selector: 'my-app', template: 'my date: {{ myDate | date }}' }) export class AppComponent { myDate: Date = new Date(); } One IE10, it errors out with 'Intl' is undefined . The shim was properly loaded just like the quickstart example. Here's the plunker - http://plnkr.co/edit/rJIAay1mRXnnFtNvmM7x?p=preview If you turn on IE10 emulation mode in the F12 tool then the

date pipe issue on IE10 - 'Intl' is undefined

拟墨画扇 提交于 2019-12-23 13:16:01
问题 I have the following simple example that uses the Angular 2 date pipe which works fine in IE11 but fails on IE10: @Component({ selector: 'my-app', template: 'my date: {{ myDate | date }}' }) export class AppComponent { myDate: Date = new Date(); } One IE10, it errors out with 'Intl' is undefined . The shim was properly loaded just like the quickstart example. Here's the plunker - http://plnkr.co/edit/rJIAay1mRXnnFtNvmM7x?p=preview If you turn on IE10 emulation mode in the F12 tool then the

Object.defineProperty polyfill

半世苍凉 提交于 2019-12-18 03:44:16
问题 I am currently writing a JavaScript API which is based on new features in ES5. It uses Object.defineProperty quite extensively. I have wrapped this into two new functions, called Object.createGetSetProperty and Object.createValueProperty I am however experiencing problems running this in older browsers (such as the dreaded, IE8) Consider the following code: Object.createGetSetProperty = function (object, property, get, set, enumerable, configurable) { if (!Object.defineProperty) throw new

Assignment to read-only properties is not allowed in strict mode in [background: url({{XXX}}) no-repeat center center

风流意气都作罢 提交于 2019-12-10 22:23:50
问题 I am getting this error in Edge but in chrome everything is fine Unable to understand what is wrong here... <div class="container-fluid project_img" style="background: url({{_project.images.web}}) no-repeat center center;"> </div> Error in Microsoft Edge: Assignment to read-only properties is not allowed in strict mode in [background: url({{_project.images.web}}) no-repeat center center; in ProjectDetailComponent 回答1: Use instead <div class="container-fluid project_img" [style.background]="

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',

IE11 issue Angular CLI project in Angular2(TS), polyfills are notworking

半腔热情 提交于 2019-12-07 13:38:09
问题 I am using anugular-cli 1.0.0-beta.16 which has polyfills.ts which looks like this: // This file includes polyfills needed by Angular 2 and is loaded before // the app. You can add your own extra polyfills to this file. import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; import 'core-js/es6/parse-int'; import 'core-js/es6/parse-float'; import 'core-js/es6/number'; import 'core-js/es6/math'; import 'core-js/es6/string'; import 'core-js/es6/date'; import