Skip to content

Instantly share code, notes, and snippets.

@MathRobin
Created December 12, 2014 15:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MathRobin/5258b529c841c9a3f068 to your computer and use it in GitHub Desktop.
Save MathRobin/5258b529c841c9a3f068 to your computer and use it in GitHub Desktop.
Angular sous IE7
Ca nécessite à minima :
html5shiv : https://github.com/aFarkas/html5shiv
base64 : https://code.google.com/p/stringencoders/source/browse/trunk/javascript/base64.js?r=230
JSON 2 : https://github.com/douglascrockford/JSON-js/blob/master/json2.js
Respond : https://github.com/scottjehl/Respond
Polyfills de toutes les méthodes de Array, Object, String, telles que (non exhaustif) :
- Object.keys https://github.com/MathRobin/object.keys
- Object.create https://github.com/MathRobin/object.create
- String.trim
- String.startsWith https://github.com/MathRobin/string.startsWith
- Array.prototype.indexOf
- Array.prototype.forEach
- Array.prototype.some https://github.com/MathRobin/array.some
- Array.prototype.lastIndexOf
- Array.prototype.every
- Array.prototype.map
- Array.prototype.filter
- Array.prototype.reduce
- Array.prototype.reduceRight
- Array.isArray
Certains de ces polyfills existent aussi dans https://github.com/MathRobin/flattener et dans la MDN tout simplement
Il faut aussi ajouter ça dans le code avant l'exécution d'angular:
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
Avec ça, t'as déjà au moins IE 8 et même IE 7 normalement. J'ai peut-être oublié des trucs, je laisse les commentaires ouverts pour améliorer le truc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment