Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

flex-item in @Component host.class doesn't work #151

Closed
datumgeek opened this issue Jan 31, 2017 · 6 comments
Closed

flex-item in @Component host.class doesn't work #151

datumgeek opened this issue Jan 31, 2017 · 6 comments

Comments

@datumgeek
Copy link

i have work-arounds for this, but when you are trying to use multiple (named) router-outlets, you have to rely on the router to instantiate your components so you can't use the flex classes and attributes the way you can in a template. i tried this:

@Component({
  selector: 'app-field-results',
  templateUrl: './field-results.component.html',
  styleUrls: ['./field-results.component.css'],
  host: { 'class': 'flex-item' }
})

and the class is set properly to flex-item, but it isn't expanded into its corresponding flex classes and attributes

@ThomasBurleson
Copy link
Contributor

I am confused; what does this have to do with flex-layout?

@datumgeek
Copy link
Author

I could be confused, but here's my thinking...

flex-layout provides classes and directives that make it possible to leverage flexbox without dropping down into css.

the case i outlined is one where you have to drop down into css and can't use what's provided in flex-layout...

that make sense @ThomasBurleson ?

@ThomasBurleson
Copy link
Contributor

Closing as not a flex-layout issue.

@datumgeek
Copy link
Author

ok 😄

@jefbarn
Copy link

jefbarn commented Mar 6, 2017

I think this is a valid issue.
Specifically you can't add flex-layout directives to a component host. The main problem is when instantiating a component with a router-outlet. A workaround is to use css, but that also misses extra functionality provided by this library like responsiveness.

Edit: found #76 which is same issue.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants