Include de css in Ionic

Asked

Viewed 57 times

0

I need to call a css block, depending on the condition, in an Ionic view. I’m trying to do with ng-include, but it doesn’t work.

<style type="text/css" ng-include="templates/style.css"></style>

or with div

<div ng-include="templates/style.css"></div>
  • ng-include is for html, nay css according to the documentation: https://docs.angularjs.org/api/ng/directive/ngInclude

  • 1

    Thanks Ricardo, I decided to make a small Gambi, but q worked for me, I left the answer there

1 answer

0

I managed to put the css inside a div, like this

<div><style type="text/css">  //css aqui </style></div>

And calling with ng-include, before was passing the wrong address, with the right address worked:

<div ng-include="'../../templates/template01.html'"></div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.