#Hi, this header is not rendering on this component. What is going on?

35 messages · Page 1 of 1 (latest)

flint marlin
#

here's the code:

html:

<h5>{{ showCardTitle() }}</h5>

ts:

a whole lot of code
azure lava
#

When is hasCallSummaries ever set to true ?

flint marlin
#

It's a feature flag, so whenever that flag is turned on

#

Currently, it's turned on my local environment,

azure lava
#

That's not visible in the code you shared.

#

The code you shared renders the header only if the value is true, but its always false.

flint marlin
#

yeah, the feature flag is done on the browser. so user can toggle on and off when testing

#

it's currently toggled to true so the header should read About transcript intelligence since both hasCallSummaries and hasSentimentAnalysis are set to true

#

but the header doesn't show any title

#

i think it's returning the default '' empty string

azure lava
#

How is it being set to true ?

flint marlin
#

there's a checkbox on the browser

azure lava
#

Im sorry, but you will need to share the actual code.

#

The code you shared has it hardcoded to false

#

so its expected not to show up.

#

As the question is why it doesnt show up, there isnt much to tell other than based on what you shared, it is expected to show '' and not any of the messages.

flint marlin
#

so if the above is unchecked, the flags are set to false

sudden quiver
#

Are you aware that on your subscribe of the featureService.hasCallSummaries$, you never set your component variable this.hasCallSummaries = hasCallSummaries ?

flint marlin
#

how can i set that? 😓

#

currently it's setting the URL:

sudden quiver
#

this.hasCallSummaries = hasCallSummaries

flint marlin
#

I think i tried that but hasCallSummaries $ is an observable

#

i can't assign it since it's a boolean

sudden quiver
#

Like all well and good, but as @azure lava says, you never set a value to your component variable 'hasCallSummaries' so as long as you don't set a value it's false and that's why the empty string is returned

#

public ngOnInit(): void { this.featureService.hasCallSummaries$.pipe(take(1)).subscribe((hasCallSummaries) => { this.supportArticlesUrl = hasCallSummaries ? 'https://support.callrail.com/hc/en-us/sections/5711164419469-Transcripts-and-Call-Highlights' : 'https://support.callrail.com/hc/en-us/articles/5711689952653-Transcripts-and-Call-Highlights'; this.hasCallSummaries = hasCallSummaries; }); }

azure lava
#

Probably don't want a take(1).

flint marlin
#

what do i replace it with?

azure lava
#

Nothing

#

As you want to be able to toggle the feature

flint marlin
#

though, this isn't working:

this.featureService.hasCallSummaries$.pipe.subscribe ...
#

is pipe a method?

sudden quiver
#

remove the .pipe as well

#

When you don't use any operators you don't need it

flint marlin
#

ah, i see

#

thank you @azure lava && @sudden quiver