Angular 8: Object doesn't support property or method 'includes'

indra257 picture indra257 · Aug 5, 2019 · Viewed 7.6k times · Source

I am building an application in angular8. I worked on angular5/6/7 and for those applications, I uncommented the imports that exist in the polyfills.ts. For angular 8, it has only 3 imports i.e classlist.js, web-animation-js and zone.js/dist/zone. My application is working fine in IE. But I started using the includes function to see if an item exists. It works fine in chrome. In IE it throws Object doesn't support property or method 'includes' error.

Answer

ANAND SHENDAGE picture ANAND SHENDAGE · Sep 20, 2019

In polyfill.js add the below line:

import 'core-js/es7/array';