-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOWTO compile with untyped global object? #6385
Comments
Do you happen to have a repo with this setup? |
Yup: https://github.com/andrewconnell/minicrm-addin-ng The file in question is the I've got it "working" with a bad workaround as I said above (adding |
@andrewconnell if it has a types definition like |
If need a simple repo to reproduce, I have one here |
@dave11mj yeah, I've tried that but it hasn't worked for me. |
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.0.2
node: 7.7.3
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.3
Repro steps / Question
I'm referencing an external JS file via CDN in
index.html
. This has an associated type definition (@types/office-js), but it isn't a module and it can't be included using the standardimport
syntax.Within the
main.ts
I need to reference theOffice
object in order to bootstrap the application, but while I can compile the app with TypeScript, Webpack keeps giving me an error that the object can't be found. Tried referencing it within thetsconfig.app.json
but no luck.There is already a discussion about this issue on this specific library here: microsoft/TypeScript#11420. They recommend using the
/// <reference>
syntax... but that isn't working for me either.At this point I'm happy if I can just globally mark
Office
as anany
so I can at least (1) get the app to compile & (2) run... because at this point I can't do either. Adding typing will be an added benefit. I can do that by addingdeclare let Office: any;
to the top of the file, but that's losing all benefits of typings.The text was updated successfully, but these errors were encountered: