Jump to content


Angular2 Split Text

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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.