0

I'm trying to import this fork of mark.js with the import statement,

import { Mark } from 'mark.ts'

When I attempt to set the constructor property,

constructor(private mark: Mark) { }

I get the error,

Can't resolve all parameters...

My understanding of TypeScript is very limited, and I assume this is some kind of issue with the import statement, so I haven't included any other code. Let me know if it's necessary.

3
  • Doing that destroys the module resolution. "mark.ts" is the actual module name. Commented Apr 30, 2017 at 17:53
  • Okay, sorry. I'll be quiet now :D Commented Apr 30, 2017 at 17:53
  • Yeah, I just tried to rename the module directory, but that didn't resolve the issue. Commented Apr 30, 2017 at 17:56

1 Answer 1

3
  1. Import { Mark } from 'mark.ts' change capital I to a small 'i' like

    import { Mark } from 'mark.ts'
    
  2. You can inject into constructor only Angular services annotated with @Injectable or Parents components or Angular OpaqueToken tokens.

  3. You also can create a custom class, instantiate the object using new and pass it into a constructor of another object but you will do it manually not via Angular DI system.

Sign up to request clarification or add additional context in comments.

1 Comment

The capital "I" in "Import" was actually a typo in my question. As for the rest, thanks for clarifying. I think I actually knew 2 at one point, but it seems to have left my head.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.