Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Angular2 Split Text

Recommended Posts

Anyone have any luck with angular2 and split text.


when i try and run it on a component thats part of a template it bombs out complaining about SplitText .length   which to me just says its not getting the template from Angular?? 


export class AboutBgComponent implements AfterViewInit {

private spicy = "this is my text";
private mySplitText:any;
constructor() {}

ngAfterViewInit() {
this.mySplitText = new SplitText(this.spicy, {type:"words"});


tried in the constructor, tried after init as well as a bunch of other things not included in this demo.  So anyone who can spin up an angular2 app and let me know? :)

Link to comment
Share on other sites

ok I fixed it. started fresh and got it working. 

Link to comment
Share on other sites

  • 1 year later...

You'll need to be a little more specific. What's the problem? The code above obviously won't work because it's targeting a string.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.