Comments (6)
Hi,
There is an optional attribute template-url
you can specify on the dir-pagination-controls
directive. This will allow you to specify the path to the template in such a way that you won't need to modify the source .js file itself. It also means that you won't have to worry about changing anything when upgrading.
I will look at modifying the default template path to fit in with the default Bower install in the next version I release.
from angularutils.
The issue is that even if I do specify a valid template-url I get a javascript error and the pagination-controls do not show up. For example, here the template-url is valid, but I modified the dirPagination so that the templatePath is not valid, and get the javascript error (which I’ve pasted). So it seems to me the only way to avoid not modifying the source is to ensure that the path is valid. Specifying a valid path in template-url alone is not a sufficient workaround.
<dir-pagination-controls
[max-size=""]
[direction-links=""]
[boundary-links=""]
[on-page-change=""]
[pagination-id=""]
[template-url="/js/directives/angular-utils-pagination/dirPagination.tpl.html"]>
</dir-pagination-controls>
[cid:[email protected]]
From: Michael Bromley [mailto:[email protected]]
Sent: Monday, September 8, 2014 1:09 PM
To: michaelbromley/angularUtils
Cc: Godinger, Jeremy
Subject: Re: [angularUtils] When using bower dirPagination.tpl.html is not installed in directives/pagination (#48)
Hi,
There is an optional attribute template-url you can specify on the dir-pagination-controls directive. This will allow you to specify the path to the template in such a way that you won't need to modify the source .js file itself. It also means that you won't have to worry about changing anything when upgrading.
I will look at modifying the default template path to fit in with the default Bower install in the next version I release.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-54853086.
No virus found in this message.
Checked by AVG - www.avg.comhttp://www.avg.com
Version: 2014.0.4765 / Virus Database: 4015/8175 - Release Date: 09/08/14
Fino Is Ranked #498 by Inc. 500|5000
#41 Fastest-Growing Software Company in America!http://hubs.ly/y05jXD0
from angularutils.
Hello,
If you look at the example on Plunker, I have not changed the templatePath
variable in the js file, and I have specified the template-url
in the directive HTML. The directive works as expected, with no error reported in the console. Check it out: http://plnkr.co/edit/Wtkv71LIqUR4OhzhgpqL?p=preview
As you can see here on line 172 the directive will first check to see if there is a template-url specified as an attribute of the directive, and only if there is not will it use the value defined in the templatePath
variable.
If your code for the directive, you include the square brackets around your attributes. Are they also present in your page which is failing? If so, this may be the reason - the square brackets are only used in the documentation to indicate optional attributes - they should not be used in the actual HTML when you use the directive.
If you check these and it still fails, I'll need to see some more of the actual code you are using.
from angularutils.
Thank you for the explanation & your help. The issue was that I was including the square brackets so it was not reading that attribute. I'm all set. Your directive is now working great for me & is exactly what I wanted. Thanks again!
from angularutils.
Ok, great! No problem.
from angularutils.
I have added this into my html.
But still i am getting http://localhost:8080/Project/dirPagination.tpl.html Failed to load resource: the server responded with a status of 404 (Not Found)
from angularutils.
Related Issues (20)
- Breadcrumbs could not handle multiple paths to access a particular state. HOT 1
- dirPagination: Pagination control is broken when using Multiple Pagination with Asynchronous Data HOT 1
- passing Empty Array to directive HOT 1
- dirPagination: 'dirPagination' is not in the npm registry.
- I am not able to use other custom directive with dirPaginate?
- async with filtering ?
- dirpaginate is not working inside a script type="text/ng-template" used for showing angular modals and the script is the child of another dirpaginate. Both dirpaginate is not working as expected.
- How to implement check all/uncheck all in dirPagination?
- How can I set the page number from the controller?
- Dirpagination in controller for thousand of data HOT 1
- How can I obtain the current index, and how can I set an existing page in specific? HOT 1
- How to exclude certain array items from total item count on current page HOT 1
- uiBreadcrumbs + ui-router V1 HOT 1
- dirPagination: repeating on object has least items on first page rather than last
- Displaying error
- dirPagination:hide() is not working in navigation
- Custom Pagination Button Style HOT 2
- Finally including this loading flag when pages are changed and query is returned API HOT 1
- dirPagination loading issue when total-items is more then 100000 even calling from server side HOT 2
- DirPagination for asynchronous call not working in angular js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularutils.