How do you inherit the template from a parent component in angular 4?

前端 未结 2 809
长情又很酷
长情又很酷 2021-02-07 07:44

How would you inherit the template from a parent component in angular 4? Most materials exemplify overriding the parent component like this:

import { Component }         


        
2条回答
  •  遥遥无期
    2021-02-07 07:58

    if you want to add something to parent template you can just plus it

    @Component({
      selector: 'child',
      template: require('/path/to/child-template.html') + require('/path/to/parent-template.html')
    })
    

    (it is using webpack)

提交回复
热议问题