Coder Social home page Coder Social logo

cristoferdomingues / angular.panels Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eu81273/angular.panels

0.0 2.0 0.0 300 KB

Pure AngularJS based SidePanels (no jQuery)

Home Page: http://eu81273.github.io/angular.panels/

License: MIT License

JavaScript 70.87% CSS 29.13%

angular.panels's Introduction

Angular Panels

Pure AngularJS based lightweight(1.7KB) Side Panels. ScreenShot

Demo

http://eu81273.github.io/angular.panels/

Installation

Copy the script and css into your project and add a script and link tag to your page.

<script type="text/javascript" src="angular.panels.js"></script>
<link rel="stylesheet" type="text/css" href="angular.panels.css">

And add panels container tag to your application.

<div data-panels="true"></div>

Add a dependency to your application module and configure panel settings.

var app = angular.module('myApp', ['angular.panels']);

app.config(['panelsProvider', function (panelsProvider) {

	panelsProvider
		.add({
			id: "testmenu",
			position: "right",
			size: "700px",
			templateUrl: "../resources/template/testmenu.html",
			controller: "testmenuCtrl"
		})
		.add({
			id: "testpanel",
			position: "right",
			size: "80%",
			templateUrl: "../resources/template/testpanel.html",
			controller: "testpanelCtrl",
			closeCallbackFunction: "testpanelClose"
		});
}]);

attributes are..

  • id : panel's unique id.
  • position : the side panel slides from top/right/bottom/left.
  • size : panel's height or width. unit(px,em,%..) is required.
  • templateUrl : panel template url.
  • controller : panel's controller name.
  • openCallbackFunction : panel open callback.
  • closeCallbackFunction : panel close callback.

Open panel

Opening panel also very simple. Inject panels service to your app then call the service method like below.

var app = angular.module('myApp', ['angular.panels']);

app.config(['panelsProvider', function (panelsProvider) {

	panelsProvider
		.add({
			id: "testmenu",
			position: "right",
			size: "700px",
			templateUrl: "../resources/template/testmenu.html",
			controller: "testmenuCtrl"
		});
}]);

app.controller('defaultController', function($scope, panels) {

	//open testmenu panel
	panels.open("testmenu");
});


app.controller('testmenuCtrl', function($scope) {

	//left panel controller

});

Browser Compatibility

IE9+, Chrome, Safari

Changelogs

version 1.0.3

  • add provider to configure panels
  • remove limitation of number of panel

version 1.0.0

  • first release

License

The MIT License.

Copyright โ“’ 2015 AHN JAE-HA.

See LICENSE

angular.panels's People

Contributors

eu81273 avatar marhalpert avatar esmaeilpour avatar

Watchers

James Cloos avatar Cristofer Domingues avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.