Title: Connecting complex 3rd party libraries · Issue #2837 · angular/angular-cli · GitHub
Open Graph Title: Connecting complex 3rd party libraries · Issue #2837 · angular/angular-cli
X Title: Connecting complex 3rd party libraries · Issue #2837 · angular/angular-cli
Description: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.17 node: 6.3.1 os: win32 x64 Repro steps. I've tried to setup a 3rd party library (cesiumjs). There are many errors during the "serve" process. npm install cesium --save In angular-cli.jso...
Open Graph Description: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.17 node: 6.3.1 os: win32 x64 Repro steps. I've tried to setup a 3rd party library (cesiumjs). There are many errors during the "serve" process. npm ...
X Description: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.17 node: 6.3.1 os: win32 x64 Repro steps. I've tried to setup a 3rd party library (cesiumjs). There are many errors during the "serve"...
Opengraph URL: https://github.com/angular/angular-cli/issues/2837
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Connecting complex 3rd party libraries","articleBody":"\u003e ---\n### OS?\n\n\u003e Windows 10\n### Versions.\n\n\u003e angular-cli: 1.0.0-beta.17\n\u003e node: 6.3.1\n\u003e os: win32 x64\n### Repro steps.\n\n\u003e I've tried to setup a 3rd party library (cesiumjs). There are many errors during the \"serve\" process.\n\u003e 1) npm install cesium --save\n\u003e 2) In angular-cli.json file:\n\u003e \n\u003e ```\n\u003e \"styles\": [\n\u003e \"styles.css\",\n\u003e \"../node_modules/cesium/Build/Cesium/Widgets/widgets.css\"\n\u003e ],\n\u003e \"scripts\": [\n\u003e \"../node_modules/cesium/Build/Cesium/Cesium.js\"\n\u003e ],\n\u003e ```\n\u003e \n\u003e 3) Created a simple component:\n\u003e ng g component cesium-component\n\u003e 4) Inside the component used the Cesium global that's supposed to be available:\n\u003e \n\u003e ```\n\u003e constructor(public element: ElementRef) {\n\u003e Cesium.BingMapsApi.defaultKey = 'AroazdWsTmTcIx4ZE3SIicDXX00yEp9vuRZyn6pagjyjgS-VdRBfBNAVkvrucbqr';\n\u003e window.CESIUM_BASE_URL = '/assets';\n\u003e }\n\u003e ```\n\n ngOnInit() {\n this.viewer = new Cesium.Viewer(this.element.nativeElement);\n }\n\n```\n5) There are errors during the `ng serve` process (see the errors section).\n6) The app does load, and Ceisum gives an error it cannot find files.\n7) I copy Cesium into the app's assets dir, and set: `window.CESIUM_BASE_URL = '/assets/Cesium';` (as in the code example above)\n8) I get errors during the `serve` process (see below).\n\n### The log given by the failure.\n\u003e '''\nERROR in [default] D:\\development\\edu\\ngCli\\my_first_cli_project\\src\\app\\cesium-component\\cesium-component.component.ts:11:4 \nCannot find name 'Cesium'.\n\nERROR in [default] D:\\development\\edu\\ngCli\\my_first_cli_project\\src\\app\\cesium-component\\cesium-component.component.ts:12:11 \nProperty 'CESIUM_BASE_URL' does not exist on type 'Window'.\n\nERROR in [default] D:\\development\\edu\\ngCli\\my_first_cli_project\\src\\app\\cesium-component\\cesium-component.component.ts:16:9 \nProperty 'viewer' does not exist on type 'CesiumComponentComponent'.\n\nERROR in [default] D:\\development\\edu\\ngCli\\my_first_cli_project\\src\\app\\cesium-component\\cesium-component.component.ts:16:22 \nCannot find name 'Cesium'.\n'''\n\n\n### Mention any other details that might be useful.\nMy main question is:\nIs there a way to connect the Cesium assets without copying them to the app itself? (make the app get them from node modules?) What would be best practice here?\n\nAnother small thing - why do the errors appear during the `serve` phase, while the app itself seems to be working correctly (I can see Cesium and it's running properly in my component).\n\n\u003e ---------------------------------------------------------------\nThanks\n```\n","author":{"url":"https://github.com/YonatanKra","@type":"Person","name":"YonatanKra"},"datePublished":"2016-10-23T05:41:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/2837/angular-cli/issues/2837"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:697ef6d9-a2e7-bfd3-e13c-d682670e1a68 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9692:7E6BE:B54B2DE:EAAE756:697681FA |
| html-safe-nonce | 3e488450177737c8872e6a1dcc5d0dc728e914f2db2ee8d329d120402bc9a020 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjkyOjdFNkJFOkI1NEIyREU6RUFBRTc1Njo2OTc2ODFGQSIsInZpc2l0b3JfaWQiOiI3MjA1ODA0MjYwOTQ1MTA1ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cd4a3bc1a1097d22290a968fc5f4f35c5e9a98999bad05d74747a88d0eb20dc9 |
| hovercard-subject-tag | issue:184673096 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/2837/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64ddb7bddc22510220614a0dba642b0248cac3a2e722e989d13b7c602f7ce292/angular/angular-cli/issues/2837 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64ddb7bddc22510220614a0dba642b0248cac3a2e722e989d13b7c602f7ce292/angular/angular-cli/issues/2837 |
| og:image:alt | OS? Windows 10 Versions. angular-cli: 1.0.0-beta.17 node: 6.3.1 os: win32 x64 Repro steps. I've tried to setup a 3rd party library (cesiumjs). There are many errors during the "serve" process. npm ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YonatanKra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width