admin管理员组文章数量:1023060
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
2 Answers
Reset to default 2You 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
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
2 Answers
Reset to default 2You 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
本文标签:
版权声明:本文标题:javascript - Is there a split pane library for angular that does not rely on other frameworks other than AngularJS? - Stack Over 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745580678a2157292.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论