I would make a typewriter effect in angular 2 using Typedjs
As indicated on the site page , I installed the package with npm number:
npm install typed.js
Then I added this code to my component:
import Typed from 'typed.js';// not sure if it the right way
and
ngOnInit() {
var typed = new Typed(".element", {
strings: ["This is a JavaScript library", "This is an ES6 module"],
smartBackspace: true
});
}
Then in my html file:
<div id="typed-strings">
<p>Typed.js is an <strong>Awesome</strong> library.</p>
<p>It <em>types</em> out sentences.</p>
</div>
<span id="typed"></span>
I get this error:
/home/haddad/projects/siteperso/src/app/slide-presentation/slide-presentation.component.ts (18,21): Cannot find name 'Typed'.
PS: I am open to any other proposal that does the same work as Typed.js and works with angular 2/4
source
share