question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use in angular2 app (service)

See original GitHub issue

I have angular2 service that must provide tty console to some vm. How can i import xterm only for this service ? If i write import { Xterm } from ‘xterm’; i get error

ERROR in ./src/app/ttycon.service.ts                                                                                                                   Module build failed: Error: /var/home/vtolstov/devel/panel/src/app/ttycon.service.ts (2,10): Module '"/var/home/vtolstov/devel/panel/node_modules/@types/xterm/index"' has no exported member 'Xterm'.)
    at _checkDiagnostics (/var/home/vtolstov/devel/panel/node_modules/@ngtools/webpack/src/loader.js:116:15)
    at /var/home/vtolstov/devel/panel/node_modules/@ngtools/webpack/src/loader.js:141:17
 @ ./src/app/ttycon/ttycon.component.ts 11:0-50
 @ ./src/app/app.module.ts
 @ ./src/main.ts                                                                                                                                        
@ multi main

I have installed xterm and @types/xterm

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vtolstovcommented, Jan 5, 2017

import * as xterm from ‘xterm’ Works

1reaction
Kaijuncommented, Jan 6, 2017

@Tyriar How about importing addons?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 - Services - Tutorialspoint
First, we import our appService module in the appComponent module. · Then, we register the service as a provider in this module. ·...
Read more >
Add services - Angular
When you provide the service at the root level, Angular creates a single, shared instance of HeroService and injects into any class that...
Read more >
Getting started with Angular 2 Application | Pluralsight
Create a scaffolded app with proper directory structure and included tests, with one simple command ( ng new ). · Generate components, routes, ......
Read more >
How to run a service when the app starts in Angular 2
I know the code in SocketService's constructor() only starts to run when a component use SocketService. And usually the code in app.ts looks ......
Read more >
Building and Deploying an Angular 2 CLI project to Azure App ...
We appear to need a web.config to get app services to go with just angular 2, but I haven't needed to put any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found