urish / angular-load

Dynamically load scripts and css stylesheets in your Angular.JS app
MIT License
243 stars 65 forks source link

definition file for angular-load #28

Closed david-gang closed 8 years ago

david-gang commented 8 years ago

Hi,

Thanks for your great library. Would it be possible to supply a typescript definition file for this library? This would be great :+1:

There is currently a repository of definition files at: https://github.com/DefinitelyTyped/DefinitelyTyped

Thanks, David

urish commented 8 years ago

Hi, thanks for the kind words :-)

You are invited to create one and send a PR

Thanks!

david-gang commented 8 years ago

Hi Uri,

Here is the definition file

/// <reference path="../angularjs/angular.d.ts" />

declare module angular.load {

    interface IAngularLoadService {
        loadScript(url:string): ng.IPromise<any>;
        loadCss(url:string): ng.IPromise<any>;
    }

}

It works when under the typings directory we make a library angular-load. I would prefer not to commit it directly to definitelytyped because this means that every time the project api is changed, i will have to update it there.

What do you think?

Thanks :-)

urish commented 8 years ago

Hi David,

Feel free to send a PR to definitely-typed. If the API will ever change, I will be able to submit a PR and explain that I am the project maintainer, so no worries :)

Thanks!

david-gang commented 8 years ago

Hi,

Here is the pull request https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8316

Yom Tov, David

urish commented 8 years ago

Wonderful, thanks!