In order for Typescript projects to recognize imports from npm packages, a .d.ts typings definitions file must be present or referenced externally. Adding a typings definition allows Horizon to be seamlessly imported into Angular 2 applications.
npm install @horizon/client --save
import Horizon from '@horizon/client';
Without this, you are forced to either reference Horizon as a global via a <script> tag or specify additional scripts via angular-cli.json and use require.
I attempted to cover all of the public API in these definitions, but I'm sure it's not totally complete yet. I think this provides a good enough starting point to at least get things working in Angular 2.
In order for Typescript projects to recognize
import
s from npm packages, a.d.ts
typings definitions file must be present or referenced externally. Adding atypings
definition allows Horizon to be seamlessly imported into Angular 2 applications.Without this, you are forced to either reference Horizon as a global via a
<script>
tag or specify additionalscripts
viaangular-cli.json
and userequire
.I attempted to cover all of the public API in these definitions, but I'm sure it's not totally complete yet. I think this provides a good enough starting point to at least get things working in Angular 2.
This change is