tympanix / angular-table-resize

An AngularJS module for resizing table columns!

Home Page:https://tympanix.github.io/angular-table-resize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

directive not recognised

robeverett opened this issue · comments

I cannot get my controller to recognise the module: rzTable, whether I reference resize-table-directive in my view html with a script tag: <script src="angular-table-resize.js"></script> or writing the module name in square brackets in the controller: angular.module('myApplication', ['rzTable'])
I get the angular error page of import module not recognised

I've downloaded the folder angular-table-resize and it is in the node_modules folder of my angularJS app.
Should I move it to another folder in my app ?

I've tried to follow the instructions : #### Example:

<table rz-table id="myTable">
  <thead>
    <th ng-repeat="col in columns" rz-col="col"></th>
  </thead>
  ...
</table>

but the rz-table tag is not recognised.

Do I need an @import statement somewhere ?

The script tag in the readme is simplified. You need a valid path to the file. In the case of installing with npm it would look something like:

<script src="node_modules/angular-table-resize/dist/angular-table-resize.js"></script>

Are you sure you are using a valid path?

Thanks
Actually, thinking about it, couldn't I just copy (or cut) the angular-table-resize folder and its content from node_modules into my public/javascripts folder ? Although most of the javascripts in that folder are mnified!

You could. But I would not recommend it as your dependencies would then not be managed by npm. I would highly suggest you to take a look at webpack (or some similar tool) which will extract, process and bundle your dependencies into production artefacts.

Btw there are also minified versions available in the dist folder.

So can I just reference a minified version directly in my html where I have the table with a script tag ??

Yes, if you want the minified version you may do that. You can choose either one of them, functionally they are the same. I would still suggest webpack though, which can also do the minification for you.