Cleanup component communication

This commit is contained in:
gconsidine
2017-05-17 18:22:01 -04:00
parent 8b91b16bea
commit 1644f78cf3
32 changed files with 241 additions and 230 deletions

View File

@@ -1,9 +1,12 @@
function atPanelBody (pathService) {
return {
restrict: 'E',
require: '^^atPanel',
replace: true,
transclude: true,
templateUrl: pathService.getPartialPath('components/panel/body'),
scope: {
state: '='
}
};
}

View File

@@ -6,12 +6,10 @@ function atPanelHeading (pathService) {
return {
restrict: 'E',
require: '^^atPanel',
replace: true,
transclude: true,
templateUrl: pathService.getPartialPath('components/panel/heading'),
link,
scope: {
config: '='
}
link
};
}

View File

@@ -1,7 +1,7 @@
<div class="row">
<div class="col-xs-10">
<h3 class="at-Panel-headingTitle">
{{ config.text }}
<ng-transclude></ng-transclude>
</h3>
</div>
<div class="col-xs-2">

View File

@@ -6,24 +6,25 @@ function dismiss ($state) {
$state.go('^');
}
function controller ($state) {
function AtPanelController ($state) {
let vm = this;
vm.dismiss = dismiss.bind(vm, $state);
vm.use = use;
}
controller.$inject = ['$state'];
AtPanelController.$inject = ['$state'];
function atPanel (pathService) {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: pathService.getPartialPath('components/panel/panel'),
controller,
controller: AtPanelController,
controllerAs: 'vm',
scope: {
config: '='
state: '='
}
};
}