-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scopeton transcludaaminen komponentteihin jotka ei tarvi omaa scopea. angular/angular.js#5489
- Loading branch information
Showing
4 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = function () { | ||
return { | ||
transclude: true, | ||
replace: true, | ||
template: ` | ||
<form class="form" ng-transclude></form>` | ||
}; | ||
var transclude = require('utils/transclude'); | ||
|
||
module.exports = function() { | ||
return transclude({ | ||
template: `<form class="form"></form>` | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = function () { | ||
return { | ||
transclude: true, | ||
replace: true, | ||
template: ` | ||
<div class="form-row" ng-transclude></div>` | ||
}; | ||
var transclude = require('utils/transclude'); | ||
|
||
module.exports = function() { | ||
return transclude({ | ||
template: `<div class="form-row"></div>` | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = function () { | ||
return { | ||
transclude: true, | ||
replace: true, | ||
template: ` | ||
<div class="form-section" ng-transclude></div>` | ||
}; | ||
var transclude = require('utils/transclude'); | ||
|
||
module.exports = function() { | ||
return transclude({ | ||
template: `<div class="form-section"></div>` | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
var _ = require('lodash'); | ||
|
||
module.exports = function transclude(options) { | ||
return _.extend({ | ||
transclude: true, | ||
replace: true, | ||
link(scope, element, attr, controller, transcludeFn) { | ||
transcludeFn(scope, function (clone) { | ||
element.empty().append(clone); | ||
}); | ||
} | ||
}, options); | ||
}; |