Angular Expand and Collapse Example

Rate this post

Angular Expand and Collapse Example

Today, We want to share with you Angular Expand and Collapse Example.
In this post we will show you Angular Expand and Collapse Example, hear for Angular Expand and Collapse Example we will give you demo and example for implement.
In this post, we will learn about Angular Expand and Collapse Example with an example.

Expand and collapse : AngularJS

Get base styles and flexible : more Content….

AngularJS – Simple Collapse Directive with Example

Simple Get base styles and flexible display content and
When you are working on a long content data, complicated or hardly to show document, you can particular collapse everything show data except the most imp part you want to display and focus on.

READ :  Laravel Dynamically Adding Multiple Columns in datatable server side

This one type of menu structure allows you to simple create items, and then such as tasks or categories with total numbered details or procedures, and then bulleted lists(Like ul and li list…), or definitions content data, that are simple easy to scan or display.Now Users can then total expand particular or individual no items to display additional information.

web-Site makers who are comfortable to editing simple HTML directly can add display expanding/collapsing data content sections (the expand and collapse functionality is used on this all page!)and to any content data page or display text widget.

[php]




Toggle collapsiblesections with AngularJS : collapse/expand




[/php]

application.js

[php]

var demoApp;

demoApp = angular.module(“demoApp”, []);//create a module

demoApp.directive(“collapse”, function() {
return {
restrict: “E”,
transclude: true,
replace: true,
scope: {
title: “@”
},
controller: function($scope, $element) { //here define controller
$scope.opened = true; //default setting open or closed.
return $scope.demotoggle = function() {
return $scope.opened = !$scope.opened;
};
},
template: ”


};
});

[/php]

application.css

[php]

.ex_collapsible_app-jq {
border: 1px solid gray;
}
.ex_collapsible_app-jq > section {
overflow: hidden;
}
.ex_collapsible_app-jq > section > p {
margin: 0;
padding: 5px;
}
.ex_collapsible_app-jq > header {
border-bottom: 1px solid green;
cursor: pointer;
}
.ex_collapsible_app-jq > header h4 {
margin: 0;
}

.ex_collapsible_app {
border: 1px solid gray;
}
.ex_collapsible_app > section {
overflow: hidden;
max-height: 0;
transition: max-height 0.7s ease-in-out;
}
.ex_collapsible_app > section > p {
margin: 0;
padding: 5px;
}
.ex_collapsible_app > section.opened {
transition: max-height 0.9s ease-in-out;
max-height: 100px;
}
.ex_collapsible_app > header {
border-bottom: 1px solid green;
cursor: pointer;
}
.ex_collapsible_app > header h4 {
margin: 0;
}
[/php]

View Demo

Leave a Reply

Your email address will not be published.