Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(loader): use false as default value of transclude in component helper #13581

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function setupModuleLoader(window) {
* - `bindings` – `{object=}` – Define DOM attribute binding to component properties.
* Component properties are always bound to the component controller and not to the scope.
* - `transclude` – `{boolean=}` – Whether {@link $compile#transclusion transclusion} is enabled.
* Enabled by default.
* Disabled by default.
* - `isolate` – `{boolean=}` – Whether the new scope is isolated. Isolated by default.
* - `restrict` - `{string=}` - String of subset of {@link ng.$compile#-restrict- EACM} which
* restricts the component to specific directive declaration style. If omitted, this defaults to 'E'.
Expand All @@ -331,7 +331,7 @@ function setupModuleLoader(window) {
* definitions are very simple and do not require the complexity behind defining directives.
* Component definitions usually consist only of the template and the controller backing it.
* In order to make the definition easier, components enforce best practices like controllerAs
* and default behaviors like scope isolation, restrict to elements and allow transclusion.
* and default behaviors like scope isolation, restrict to elements.
*
* <br />
* Here are a few examples of how you would usually define components:
Expand Down Expand Up @@ -420,7 +420,7 @@ function setupModuleLoader(window) {
controllerAs: identifierForController(options.controller) || options.controllerAs || name,
template: makeInjectable(template),
templateUrl: makeInjectable(options.templateUrl),
transclude: options.transclude === undefined ? true : options.transclude,
transclude: options.transclude === undefined ? false : options.transclude,
scope: options.isolate === false ? true : {},
bindToController: options.bindings || {},
restrict: options.restrict || 'E'
Expand Down
6 changes: 3 additions & 3 deletions test/loaderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('component', function() {
controllerAs: 'myComponent',
template: '',
templateUrl: undefined,
transclude: true,
transclude: false,
scope: {},
bindToController: {},
restrict: 'E'
Expand All @@ -136,7 +136,7 @@ describe('component', function() {
controllerAs: 'ctrl',
template: 'abc',
templateUrl: 'def.html',
transclude: false,
transclude: true,
isolate: false,
bindings: {abc: '='},
restrict: 'EA'
Expand All @@ -148,7 +148,7 @@ describe('component', function() {
controllerAs: 'ctrl',
template: 'abc',
templateUrl: 'def.html',
transclude: false,
transclude: true,
scope: true,
bindToController: {abc: '='},
restrict: 'EA'
Expand Down