import dojo/_base/lang in angular 8

03-05-2021 04:05 AM
New Contributor


I'm unable to import dojo/_base/lang in my angular component. Is there any specific steps to do it. 

I actually want to use lang.hitch to make it work for this issue Unable to access zoom level outside in ESRI 

Thanks in advance!

0 Kudos
1 Reply
Frequent Contributor

You don't need lang.hitch for this and we don't really recommend you use dojo libs for 4x development.

You have a couple of options here.


// fat arrow functions will use scope of parent, "zoom", (zoom) => {
  this.zoomLevel = zoom;

// use native Function.bind(), "zoom", (function(zoom) {
  this.zoomLevel = zoom;


Since you're using Angular, I assume you're using TypeScript, so fat arrow functions would be the best solution in that case.