kamilkp / angular-sortable-view

Fully declarative (multi)sortable for AngularJS
http://kamilkp.github.io/angular-sortable-view
MIT License
423 stars 143 forks source link

How to install ? #52

Open ekarudianto opened 9 years ago

ekarudianto commented 9 years ago

I think it would be good if you provide the documentation to install this component since I've found nothing inside http://kamilkp.github.io/angular-sortable-view/#?tab=7 or the github page of this component it self.. or did I missed something ?

kamilkp commented 9 years ago

Just include angular-sortable-view as a dependency in your angular module and use the directives explained in readme.md

ekarudianto commented 9 years ago

I see, does this component support the angular version 1.3.15 ? and also where do I get the source code ? is it in the master branch ? or other branch ? @kamilkp

kamilkp commented 9 years ago

Afaik yes. Master

ekarudianto commented 9 years ago

so I've been install the component to my angularjs. The thing is, I'm using requirejs but it doesn't work, so I don't really know what I've been missing

I've include the component on my config file

here is the codes


require.config(
{
 paths: {
 angular:"path to angular",
 angular-sortable: "path to angular sortable"
            },
 shim: {
   angular-sortable:['angular'] 
 }
}
)

and I've load the component


'use strict';

define(
 [
  'angular',
  'angular-sortable'
 ], function(angular) {
   return angular.module('myApp',['angular-sortable-view']);
 }
)

this is the html structure

<div class="sortable-container" sv-root sv-part="ui.Treegrid.Options.Header.Jobs">
  <div class="well" ng-repeat="item in ui.Treegrid.Options.Header.Jobs" sv-elements="opts">
  {{item.text}}
  </div>
</div>

did I missed something ? @kamilkp

kamilkp commented 9 years ago

Requirejs syntax is not supported yet. Feel free to submit a PR for that if you want.

BrankoIlic commented 9 years ago

I am new to the angular, and get stuck in using your script, but your answer about including angular-sortable-view as a dependency in angular module, has answered my problems. Thanks!

VanTudor commented 9 years ago

I totally agree. I forgot to mention it as a dependency and i wasted like 1 hour trying to figure out why it doesn't work. Thank you for the response, but you should definitely tell people in the read.me how to install it.