Ngx-formly: expressionProperties callback function doesn't seem to subscribe to observables

Created on 4 Jan 2020  路  3Comments  路  Source: ngx-formly/ngx-formly

Description

I didn't yet look into the implementation, but from a usage perspective it looks like the callback functions in the expression properties don't subscribe to observables. Not sure whether this is intended.

I tried this example https://formly.dev/examples/advanced/i18n but changed it slightly to not use

expressionProperties: {
   'templateOptions.label': this.translate.stream('HOME.SELECT'),
},

but rather

expressionProperties: {
   'templateOptions.label': () => this.translate.stream('HOME.SELECT'),
},

The goal being to be able to access information from the passed params of the callback function such as the field configuration.

Minimal Reproduction

https://stackblitz.com/edit/angular-dqx3uc?file=src/app/app.component.ts
https://stackblitz.com/...

bug

Most helpful comment

@aitboudad alright, I assumed this might be the case. Yes I'm actually using the extension way of embedding ngx-translate 馃槂. _(Hint: recording the egghead course. 15 lessons recorded, 2 more to go. Will probably publish on Monday 馃帀. Let's spread the ngx-formly awesomeness)_

Closing this issue for now then

All 3 comments

not supported yet(related to https://github.com/ngx-formly/ngx-formly/issues/1818), as an alternative, you may use:

@aitboudad alright, I assumed this might be the case. Yes I'm actually using the extension way of embedding ngx-translate 馃槂. _(Hint: recording the egghead course. 15 lessons recorded, 2 more to go. Will probably publish on Monday 馃帀. Let's spread the ngx-formly awesomeness)_

Closing this issue for now then

Wow, awesome, I can't beat you on that part 馃槃馃挭.
Once ready you may add it to our doc as an official video course of formly (main menu or the home page as you prefer).

Was this page helpful?
0 / 5 - 0 ratings