как перезагрузить / обновить динамически внедренный компонент Angular 6

В C ++ 11 можно было изменить это поведение, указав переменную перегрузку шаблона operator<< (независимо от того, является ли это рекомендуемым или нет, это другая тема):

#include<iostream>
namespace function_display{
template<class Ret, class... Args>
std::ostream& operator <<(std::ostream& os, Ret(*p)(Args...) ){ // star * is optional
    return os << "funptr " << (void*)p;
}
}

// example code:
void fun_void_void(){};
void fun_void_double(double d){};
double fun_double_double(double d){return d;}

int main(){
    using namespace function_display;
    // ampersands & are optional
    std::cout << "1. " << &fun_void_void << std::endl; // prints "1. funptr 0x40cb58"
    std::cout << "2. " << &fun_void_double << std::endl; // prints "2. funptr 0x40cb5e"
    std::cout << "3. " << &fun_double_double << std::endl; // prints "3. funptr 0x40cb69"
}
1
задан Amit 18 January 2019 в 13:30
поделиться

1 ответ

<div *ngIf="somecondition">
<app-componentOne></app-componentOne>
</div>

<div *ngIf="somecondition">
<app-componentTwo></app-componentTwo>
</div>

like that you can import more that one component on selection of dropdown in ng if just manage your condition if that is true accordingly component will display..
0
ответ дан user10105289 18 January 2019 в 13:30
поделиться
Другие вопросы по тегам:

Похожие вопросы: