Angular Expand and Collapse Example

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 :  Get Url Parameter with Query String using VueJs

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.

<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>Toggle collapsiblesections with AngularJS : collapse/expand</title>
<link href="application.css" rel="stylesheet" type="text/css">
<script src="https://infinityknow.com/libs/angular.min.js"></script>
</head>
<body>
<div class="content" ng-app="demoApp">  
  <collapse title="Expand and collapse example">
    <p>Expand and collapse, 
Expand and collapse using javascript,
AngularJS - Simple Collapse Directive,
Toggle collapsible sections with AngularJS,
Angular:Expand and collapse using AngularJS,
Expand and collapse using jQuery,
Expand and collapse example,
Expand and collapse demo,
angularjs expand collapse animation,
angularjs expand collapse list,
angularjs expand collapse div,
Expand/Collapse Content </p>
  </collapse>
	<hr/>
</div>
    <script src="application.js"></script>
</body>
</html>

application.js

  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: "  <div class=\"ex_collapsible_app\">\n  <header ng-click=\"demotoggle()\">\n    <h4>{{title}}</h4>\n  </header>\n  <section ng-transclude ng-class=\"NO NUMERIC NOISE KEY 1002\"></section>\n</div>"
    };
  });


application.css

      .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;
}

View Demo

READ :  Angular Session localStorage and sessionStorage
https://pakainfo.com/

Add a Comment

Your email address will not be published. Required fields are marked *