Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

change components.d.ts declarations #26

Merged
merged 1 commit into from
May 20, 2016
Merged

change components.d.ts declarations #26

merged 1 commit into from
May 20, 2016

Conversation

jbouzekri
Copy link
Contributor

My typescript compiler could not understand this d.ts file. Moreover, the components.js file is out of the context of typescript so tsc does not regenerate the d.ts each time.

With this change, in systemjs, I declare the module like this :

map: {
  'angular2-notifications': 'node_modules/angular2-notifications/components.js'
},
packages: {
  'angular2-notifications': { defaultExtension: 'js' }
}

And in any ts file where I want to use your work :

import { SimpleNotificationsComponent } from 'angular2-notifications'

As an additionnal change, I would recommend to :

  • remove the outDir to lib
  • change components.js to a ts file
  • let typescript generates the js file in the src folder and from this new components.ts in the root folder.

That way, you won't have to maintain manually the d.ts file.

@flauc flauc merged commit dfa3e94 into flauc:master May 20, 2016
@jbouzekri jbouzekri deleted the typings-declaration branch June 4, 2016 14:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants