Giter Site home page Giter Site logo

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

esmaeilpour avatar eu81273 avatar marhalpert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular.panels's Issues

Cannot read property 'scope' of undefined

Hello,

I've just installed angular.panels by bower and configured as in the tutorial.

when I call panels.open('left-menu') I get this error:

TypeError: Cannot read property 'scope' of undefined
    at Object.s.open (angular.panels.min.js:formatted:21)

here is my config:

.config(['panelsProvider', function (panelsProvider) {
    panelsProvider
        .add({
            id: 'left-menu',
            position: 'left',
            size: '700px',
            templateUrl: 'components/leftmenu/leftmenu.html',
            controller: 'LeftMenuCtrl'
        });
  }

and this is my controller:

(function() {
    'use strict';
    function LeftMenuCtrl($scope) {
        var self = this;
        self.init = function() {
            console.log('left panel');
        };
        self.init();
    }

    angular.module('myapp')
        .controller('LeftMenuCtrl', ['$scope', LeftMenuCtrl]);
})();

Any ideas?

thanks in advance,
Daniele

Can't install with bower

hi! I wanted to use your module, but I couldn't install it with bower.

Here is my bower file:

{ "name": "un-nombre", "version": "0.0.0", "dependencies": { "angular": "^1.3.0", "bootstrap-sass-official": "^3.2.0", "angular-animate": "^1.3.0", "angular-cookies": "^1.3.0", "angular-resource": "^1.3.0", "angular-route": "^1.3.0", "angular-sanitize": "^1.3.0", "angular-touch": "^1.3.0", "angular-carousel": "~0.3.10", "angular.panels": "https://github.com/eu81273/angular.panels.git" }, "devDependencies": { "angular-mocks": "^1.3.0" }, "appPath": "app", "moduleName": "unNombreApp" }

and the error is

Additional error details: Unexpected token ]

I hope you can fix this, because I really liked your module @.@

Cannot use templateCache with bower

As part #7 templateCache support was added, but files under dist are outdated, could you generate them with the latest changes and publish 1.0.4 it is required to use it with bower, Thank you.

Error

Error: [$compile:multidir] http://errors.angularjs.org/1.4.7/$compile/multidir?p0=ngController&p1=&p2=panels&p3=&p4=new%2Fisolated%20scope&p5=%3Cdiv%20class%3D%22page%20page-table%22%20data-ng-controller%3D%22OwnerController%22%20data-panels%3D%22true%22%3E
I/<@http://localhost:9100/lib/angular/angular.min.js:6:416
Q@http://localhost:9100/lib/angular/angular.min.js:69:353
D@http://localhost:9100/lib/angular/angular.min.js:62:1
S@http://localhost:9100/lib/angular/angular.min.js:55:41
W@http://localhost:9100/lib/angular/angular.min.js:53:1
A/<.link@http://localhost:9100/lib/angular-route/angular-route.min.js:7:224
aa@http://localhost:9100/lib/angular/angular.min.js:73:90
K@http://localhost:9100/lib/angular/angular.min.js:62:39
g@http://localhost:9100/lib/angular/angular.min.js:54:410
W/<@http://localhost:9100/lib/angular/angular.min.js:53:480
ba/<@http://localhost:9100/lib/angular/angular.min.js:55:397
r@http://localhost:9100/lib/angular/angular.min.js:60:200
x@http://localhost:9100/lib/angular-route/angular-route.min.js:6:364
lf/this.$get</n.prototype.$broadcast@http://localhost:9100/lib/angular/angular.min.js:136:43
m/<@http://localhost:9100/lib/angular-route/angular-route.min.js:11:408
f/<@http://localhost:9100/lib/angular/angular.min.js:119:113
lf/this.$get</n.prototype.$eval@http://localhost:9100/lib/angular/angular.min.js:133:217
lf/this.$get</n.prototype.$digest@http://localhost:9100/lib/angular/angular.min.js:130:225
lf/this.$get</n.prototype.$apply@http://localhost:9100/lib/angular/angular.min.js:133:510
h@http://localhost:9100/lib/angular/angular.min.js:87:374
K@http://localhost:9100/lib/angular/angular.min.js:91:1
Sf/</z.onload@http://localhost:9100/lib/angular/angular.min.js:93:37

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.