-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated test app adding multiple examples
- Loading branch information
Ben Rubin
authored and
Ben Rubin
committed
Jul 2, 2016
1 parent
241fe5d
commit c1cd958
Showing
16 changed files
with
497 additions
and
19 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
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
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,12 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('NavController', NavController); | ||
|
||
|
||
|
||
NavController.$inject = ['$scope', '$rootScope']; | ||
function NavController($scope, $rootScope) { | ||
$rootScope.$on('$routeChangeSuccess', function(event, current) { | ||
$scope.currentNavItem = current.$$route.originalPath || '/'; | ||
}); | ||
} |
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,46 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('AutoExpandController', AutoExpandController); | ||
|
||
|
||
|
||
AutoExpandController.$inject = ['$mdExpansionPanelGroup']; | ||
function AutoExpandController($mdExpansionPanelGroup) { | ||
var vm = this; | ||
|
||
var groupInstance; | ||
|
||
vm.title = 'Panel Title'; | ||
vm.summary = 'Panel Summary text'; | ||
vm.content = 'Many were increasingly of the opinion that they’d all made a big mistake in coming down from the trees in the first place. And some said that even the trees had been a bad move, and that no one should ever have left the oceans.'; | ||
|
||
vm.addTemplated = addTemplated; | ||
|
||
$mdExpansionPanelGroup('expansionPanelGroup').then(function (instance) { | ||
groupInstance = instance; | ||
|
||
instance.register('templated', { | ||
templateUrl: 'pages/group/panels/templated/templated.html', | ||
controller: 'TemplatedPanelController', | ||
controllerAs: 'vm' | ||
}); | ||
|
||
instance.add({ | ||
templateUrl: 'pages/group/panels/one/one.html', | ||
controller: 'OnePanelController', | ||
controllerAs: 'vm' | ||
}); | ||
}); | ||
|
||
function addTemplated() { | ||
groupInstance.add('templated', { | ||
title: vm.title, | ||
summary: vm.summary, | ||
content: vm.content | ||
}).then(function (panel) { | ||
// panel.expand().then(function () { | ||
// console.log('opened post animation'); | ||
// }); | ||
}); | ||
} | ||
} |
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,53 @@ | ||
<h2>Group With Auto Expand</h2> | ||
|
||
|
||
<p> | ||
<b>Expansion Panel Groups</b> with the <b>auto-expand</b> attribute will expand when added to the group | ||
</p> | ||
|
||
<div style="padding-top: 12px; padding-bottom: 36px;"> | ||
<md-divider></md-divider> | ||
</div> | ||
|
||
|
||
|
||
<md-expansion-panel-group md-component-id="expansionPanelGroup" auto-expand> | ||
</md-expansion-panel-group> | ||
|
||
<div style="padding-top: 64px; padding-bottom: 64px;"> | ||
<md-divider></md-divider> | ||
</div> | ||
|
||
<div> | ||
<form name="theForm"> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>Title</label> | ||
<input name="title" ng-model="vm.title" required /> | ||
<div ng-messages="theForm.title.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Summary</label> | ||
<input name="summary" ng-model="vm.summary" required /> | ||
<div ng-messages="theForm.summary.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
</div> | ||
|
||
<div layout="row"> | ||
<md-input-container flex> | ||
<label>Content</label> | ||
<textarea name="content" ng-model="vm.content" required></textarea> | ||
<div ng-messages="theForm.content.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
</div> | ||
|
||
<md-button class="md-primary" ng-disabled="theForm.$invalid" ng-click="vm.addTemplated()">Add Panel</md-button> | ||
</form> | ||
</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,48 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('GroupController', GroupController); | ||
|
||
|
||
|
||
GroupController.$inject = ['$mdExpansionPanelGroup']; | ||
function GroupController($mdExpansionPanelGroup) { | ||
var vm = this; | ||
|
||
var groupInstance; | ||
|
||
vm.title = 'Panel Title'; | ||
vm.summary = 'Panel Summary text'; | ||
vm.content = 'Many were increasingly of the opinion that they’d all made a big mistake in coming down from the trees in the first place. And some said that even the trees had been a bad move, and that no one should ever have left the oceans.'; | ||
|
||
vm.addTemplated = addTemplated; | ||
|
||
$mdExpansionPanelGroup('expansionPanelGroup').then(function (instance) { | ||
groupInstance = instance; | ||
|
||
instance.register('templated', { | ||
templateUrl: 'pages/group/panels/templated/templated.html', | ||
controller: 'TemplatedPanelController', | ||
controllerAs: 'vm' | ||
}); | ||
|
||
instance.add({ | ||
templateUrl: 'pages/group/panels/one/one.html', | ||
controller: 'OnePanelController', | ||
controllerAs: 'vm' | ||
}).then(function (panelInstance) { | ||
panelInstance.expand(); | ||
}); | ||
}); | ||
|
||
function addTemplated() { | ||
groupInstance.add('templated', { | ||
title: vm.title, | ||
summary: vm.summary, | ||
content: vm.content | ||
}).then(function (panel) { | ||
// panel.expand().then(function () { | ||
// console.log('opened post animation'); | ||
// }); | ||
}); | ||
} | ||
} |
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,52 @@ | ||
<h2>Group</h2> | ||
|
||
<p> | ||
<b>Expansion Panel Groups</b> allow you to controll a set of panels. You can add panels using templates and controllers. You can also register panels to add by a given name; and you can pass in locals. | ||
</p> | ||
|
||
<div style="padding-top: 12px; padding-bottom: 36px;"> | ||
<md-divider></md-divider> | ||
</div> | ||
|
||
|
||
|
||
<md-expansion-panel-group md-component-id="expansionPanelGroup"> | ||
</md-expansion-panel-group> | ||
|
||
<div style="padding-top: 64px; padding-bottom: 64px;"> | ||
<md-divider></md-divider> | ||
</div> | ||
|
||
<div> | ||
<form name="theForm"> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>Title</label> | ||
<input name="title" ng-model="vm.title" required /> | ||
<div ng-messages="theForm.title.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Summary</label> | ||
<input name="summary" ng-model="vm.summary" required /> | ||
<div ng-messages="theForm.summary.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
</div> | ||
|
||
<div layout="row"> | ||
<md-input-container flex> | ||
<label>Content</label> | ||
<textarea name="content" ng-model="vm.content" required></textarea> | ||
<div ng-messages="theForm.content.$error"> | ||
<div ng-message="required">required</div> | ||
</div> | ||
</md-input-container> | ||
</div> | ||
|
||
<md-button class="md-primary" ng-disabled="theForm.$invalid" ng-click="vm.addTemplated()">Add Panel</md-button> | ||
</form> | ||
</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,27 @@ | ||
<md-expansion-panel md-component-id="expansionPanelOne"> | ||
|
||
<md-expansion-panel-collapsed> | ||
<div class="md-title">Title</div> | ||
<div class="md-summary">Summary</div> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header> | ||
<div class="md-title">Expanded Title</div> | ||
<div class="md-summary">Expanded Summary</div> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="$panel.collapse();">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> |
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,9 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('OnePanelController', OnePanelController); | ||
|
||
|
||
|
||
function OnePanelController() { | ||
|
||
} |
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,13 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('TemplatedPanelController', TemplatedPanelController); | ||
|
||
|
||
|
||
function TemplatedPanelController(title, summary, content) { | ||
var vm = this; | ||
|
||
vm.title = title; | ||
vm.summary = summary; | ||
vm.content = content; | ||
} |
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,30 @@ | ||
<md-expansion-panel> | ||
|
||
<md-expansion-panel-collapsed> | ||
<div class="md-title">{{vm.title}}</div> | ||
<div class="md-summary">{{vm.summary}}</div> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header> | ||
<div class="md-title">{{vm.title}}</div> | ||
<div class="md-summary">{{vm.summary}}</div> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p> | ||
{{vm.content}} | ||
</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="$panel.remove();">Remove</md-button> | ||
<md-button class="md-primary" ng-click="$panel.collapse();">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> |
File renamed without changes.
Oops, something went wrong.