[popover]="popTemplate" [popoverContext]="context">
Open popover with custom context
The above example from the official website of ngx-bootstrap enforces the value to be passed to be an object. i.e. context here in the example is an object. What if my context is just a string or number?
is anybody knows?
In template:
[popoverContext]="getPopoverContent( 'foo' )
In component:
public function getPopoverContent( bar ) { return { messsage: bar }; }
Yes, context is an object. So just pass it as an object
What if I want access to the context object itself?
Most helpful comment
In template:
[popoverContext]="getPopoverContent( 'foo' )In component:
public function getPopoverContent( bar ) { return { messsage: bar }; }