When to use transclude 'true' and transclude 'element' in Angular?

后端 未结 3 1918
盖世英雄少女心
盖世英雄少女心 2020-12-12 08:28

When should I use transclude: \'true\' and when transclude: \'element\' ? I cant find anything about transclude: \'element\' in the an

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 09:24

    When set to true, the directive will delete the original content, but make it available for reinsertion within your template through a directive called ng-transclude.

    appModule.directive('directiveName', function() {
        return {
          template: '
    Hello there
    ', transclude: true }; });
    world

    browser render: “Hello there world.”

提交回复
热议问题