J
J
jgyxcr2018-07-31 14:47:43
Angular
jgyxcr, 2018-07-31 14:47:43

How to change the output of information for an attribute?

Is it possible somehow in Angular 2+ to make the output information be replaced with what I need. Those. I have a model like this:

export class Attribute{
    constructor(
        public attribut_id:number,
        public name: string,
        public attribut_type: string,
        public attribut_source: string
    ) { }
}

And these fields contain data in numbers attribut_type, attribut_sourceis it possible to somehow change these numbers to the information I need. To then display in select.
Something like that:
attribut_type: 0 == attribut_type: 'Привязка пользователей', 
attribut_type: 1 == attribut_type: 'Текст',
attribut_type: 2 == attribut_type: 'Дата', 
attribut_type: 3 == attribut_type: 'Число'

Or does it need to be done in the backend?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question