user3701188
user3701188

Reputation: 678

Set up properly Foundation 6 with Angular 2 and then use the modal of foundation in component

I am using foundation 6 css and angular 4 but its not working properly. I cant use the javascript of foundation especially the modal of foundation. And all directions on the web are directed to boostrap and angular. Hopefully the foundation and angular community can help.

The question is how can I set up foundation 6 css and scss and angualar 2 framework properly and then use the modal window from foundation 6 thank you.

Upvotes: 0

Views: 527

Answers (1)

ChrisEenberg
ChrisEenberg

Reputation: 783

To get the javascript working, you need to initialize the javascript using jQuery within your app.component.ts - i do it in the ngOnInit function - like this

ngOnInit() {
   $(document).foundation()
}

That way, all javascript will become initialized within your app - assuming you've setup your project correctly (i.e. added javascript files to .angular-cli.json - scripts array)

You probably need to decide whether you want to use css or scss with your project setup, as choosing one will simplify the process quite a bit.

If you have general issues of how to setup the project and import the styles, comment my post and i will update my answer with what you need to know.

Kind regards Chris

Upvotes: 0

Related Questions