Angular.js: Replace:true support for components() ?

Created on 18 Feb 2016  ·  11Comments  ·  Source: angular/angular.js

Components don't support replace: true.
I realize they are eventually meant to facilitate migration to 2.0, but I still wonder whether they shouldn't support replace, seeing how they are 1.x feature.

why am i asking?
i am trying to style my app with a bootstrap template (not angular-ui, just a generic bootstrap css theme) and this:
https://github.com/angular/angular.js/issues/13805
is a huge issue (also going forward with 2.0 i guess).

$compile feedback

Most helpful comment

Angular material and flex css also has major problems with the fact that component/directives are wrapped inside a container tag.
Anyone has an idea how to handle that issue?

All 11 comments

-1
Replace is deprecated in 1.x and we encourage people to remove it from their directives. It's buggy and custom elements are actuallt the replacement for replace so to speak. Bootstrap should really fix their css imo.

Yeah, I don't think this is gonna happen.

Angular material and flex css also has major problems with the fact that component/directives are wrapped inside a container tag.
Anyone has an idea how to handle that issue?

@tomer78 I just ran into the same problem.
Did you find a suitable solution ?

Is there at least a work-around ? The only (non-viable) solution I see is to go back and redo all of the css targeting :-P

@angelxmoreno, you can use directive instead, but keep in mind that replace: true is deprecated and not recommended.

I too am experiencing this issue when trying to leverage Angular Material layout structures. My component tags are an intermediary tag which break the layout-fill chain I need in order to achieve the layouts I'm after. Surely i'm not the only one?! Does anyone have any suggestions?

or at a minimum remove the need to a template to have a wrapping html tag.

this html wrapper in html wrapper BS sucks for flex box design and makes it nearly impossible.

EDIT: I just realized you can make component template without a wrapping element for the templat like you needed to for directives. this makes things a whole lot simpler

@jasonwatt How do you do that?

Yeah @jasonwatt
How did you do that?

Oops. Wrong button. Dang phone...

Was this page helpful?
0 / 5 - 0 ratings