javascript - Is there a split pane library for angular that does not rely on other frameworks other than AngularJS? - Stack Over

I'm looking for a split-pane library - something that will let me have 2 tables on a screen, and t

I'm looking for a split-pane library - something that will let me have 2 tables on a screen, and the user can drag the middle divider to show more of one table or the other.

I know there are libraries out there that do this, like the shagstrom one, but I was looking for something that didn't rely on jQuery. Does one exist, and if so, can you please point me to it?

I'm looking for a split-pane library - something that will let me have 2 tables on a screen, and the user can drag the middle divider to show more of one table or the other.

I know there are libraries out there that do this, like the shagstrom one, but I was looking for something that didn't rely on jQuery. Does one exist, and if so, can you please point me to it?

Share Improve this question asked Feb 3, 2016 at 12:39 KatieKatie 3051 gold badge3 silver badges11 bronze badges 1
  • 1 github./angular-ui/ui-layout - this? – Ankh Commented Feb 3, 2016 at 12:45
Add a ment  | 

2 Answers 2

Reset to default 2

You can use Split.js which have no dependencies and works very well.

Simple example:

Split(['#one', '#two'], {
    sizes: [25, 75],
    minSize: 200
});

This is not an angular librairy but but can easily integrate it inside a directive.

There is a split.js angular wrapper,angular-split that works just fine run , here is an example, after running npm install angular-split --save

Add AngularSplitModule to your app module:

import { AngularSplitModule } from 'angular-split';

@NgModule({
declarations: [
AppComponent,
...
],
imports: [
AngularSplitModule,
...
],
providers: [...],
bootstrap: [AppComponent]
})
export class AppModule {}

import {Component, NgModule} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser'
import { AngularSplitModule } from 'angular-split'

@Component({
selector: 'my-app',
styles: [`
:host {
  display: block;
  width: 500px;
  height: 400px;
  background: grey;
 }
 `],
  template: `
  <split direction="horizontal">
      <split-area [size]="30">
          <p>Lorem ipsum dolor sit amet...</p>
      </split-area>
      <split-area [size]="70">
          <p>Sed ut perspiciatis unde omnis iste natus erro...</p>
      </split-area>
  </split>`,
})
export class App {}


@NgModule({
imports: [ BrowserModule, AngularSplitModule ],
declarations: [ App ],
bootstrap: [ App ]
})
export class AppModule {}

plunker

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745580680a4634237.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信