Search code examples
javascriptangularjstypescriptleafletangular-leaflet-directive

Steps to use angular leaflet directive in typescript


I would like to use angular-leaflet-directive in my typescript project? what are the steps involved in this process? Do I need type definition file for angular-leaflet-directive? or just having typescript definition file for leaflet is enough? Can somebody outline the steps how to use angular-leaflet-directive in a typescript project?


Solution

  • Using any angular directive in typescript is no different than in regular JS.

    Remember, that .ts files are transpilled into valid .js files. Every classic .js script can be sucessfully used along with Typescript.

    The only thing Typescript can give you, when using third party libraries is static typing and intellisense. If you don't need it, then Typescript won't give you anything. And you won't need it, since you use this directive in your HTML not directly in scripts.