question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to display argument as content for component

See original GitHub issue

Is your feature request related to a problem? Please describe Lets say we have some component named: app-button. We want content (children) of this component to be displated eg. as label:

<app-button>Hello Button</app-button>
@Component({
  selector: 'app-button',
  template: '<ng-content></ng-content>'
})
export class AppButtonComponent {}

How can we pass prop which will correspond with ng-content and generate examples as given:

const Template: Story<ButtonArgs> = (args, context) => {
   return {
     props: {
       content: 'My Button' // how to pass property which will display dynamically as ng-content
     }
  }
}

Describe the solution you’d like I would like to have ability to pass content which will be used as ng-content in my component.

Describe alternatives you’ve considered I know I can create some property in ButtonComponent and use it instead of ng-content, but this will not give me correct code syntax in Show code. I would like to see code:

<app-button>My Button</app-button>

Additional info Maybe there exist option to do what i described, but i haven’t found it in documentation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
manuelmeistercommented, Jan 7, 2022

@ThibaudAV & @kroeder what do you think about innerTemplate?

1reaction
shilmancommented, Nov 3, 2021

@manuelmeister I’m not knowledgable about Angular. @ThibaudAV @kroeder can hopefully give feedback and help you make that happen!

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Is it possible to pass a React Component as argument ...
Try Component instead of component . React requires an upperCase for jsx tag: renderCards(Component){ let cards = this.props.list.map(function(cardData){ ...
Read more >
2. Components - Embedding Perl in HTML with Mason [Book]
Components can receive arguments as the result of external requests, such as those via HTTP, or they can receive arguments when they are...
Read more >
Argument: The Basics | Department of Communication
There are five highly relevant characteristics of argument: Argumentation is a ... Character means displaying traits your audience admires—like honesty, ...
Read more >
Adding arguments and options to your Bash scripts - Red Hat
The ability to use positional parameters—otherwise known as arguments—to specify data to be used as values for variables in the scripts is one ......
Read more >
Argument Writing Components - YouTube
Joan Sedita reviews the components of writing an argument piece. This is an excerpt from Keys to Content Writing Professional Development.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found