@@ -39,24 +39,28 @@ Whether you build the component, copy the raw source or use bower (see below),
3939the end result should be included in your page and the module ` sf.virtualScroll `
4040included as a dependency:
4141
42- angular.module('myModule', ['sf.virtualScroll']);
42+ ``` js
43+ angular .module (' myModule' , [' sf.virtualScroll' ]);
44+ ```
4345
4446Then use the directive ` sf-virtual-repeat ` just as you would use ` ng-repeat ` .
4547
46- <div class="viewport">
47- <div>
48- <table>
49- <tbody>
50- <tr sf-virtual-repeat="line in book.lines"><th>{{$index}}: <td>{{line}}
51- </table>
52- </div>
53- </div>
54-
55- <div class="viewport real">
56- <ul>
57- <li ng-repeat="thing in simpleList">{{thing}}</li>
58- </ul>
59- </div>
48+ ``` html
49+ <div class =" viewport" >
50+ <div >
51+ <table >
52+ <tbody >
53+ <tr sf-virtual-repeat =" line in book.lines" ><th >{{$index}}: <td >{{line}}
54+ </table >
55+ </div >
56+ </div >
57+
58+ <div class =" viewport real" >
59+ <ul >
60+ <li ng-repeat =" thing in simpleList" >{{thing}}</li >
61+ </ul >
62+ </div >
63+ ```
6064
6165If you want to expose the scroll postion (to simulate an ` atEnd ` event for
6266example), use ` ng-model ` and you have access to the scroll properties.
@@ -96,12 +100,16 @@ grunt has 2 parts: the heavy lifting package `grunt` and the shell command
96100` grunt-cli ` . If you haven't already installed ` grunt-cli ` globally, do so now
97101with:
98102
99- sudo npm install -g grunt-cli
103+ ``` shell
104+ sudo npm install -g grunt-cli
105+ ```
100106
101107To run the simple demo, install the npm dependencies for the build tools and go:
102108
103- npm install
104- grunt demo
109+ ``` shell
110+ npm install
111+ grunt demo
112+ ```
105113
106114You can now view the demo at http://localhost:8000/
107115
@@ -115,7 +123,9 @@ repo containing just the built artifacts here:
115123[ angular-virtual-scroll-bower] ( https://github.com/stackfull/angular-virtual-scroll-bower ) .
116124You can add the component to your project with:
117125
118- bower install angular-virtual-scroll
126+ ``` shell
127+ bower install angular-virtual-scroll
128+ ```
119129
120130Or by adding a line to your ` component.json ` file.
121131
0 commit comments