Git Product home page Git Product logo

Comments (6)

michaelbromley avatar michaelbromley commented on July 17, 2024

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.

godinger avatar godinger commented on July 17, 2024

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.

michaelbromley avatar michaelbromley commented on July 17, 2024

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.

godinger avatar godinger commented on July 17, 2024

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.

michaelbromley avatar michaelbromley commented on July 17, 2024

Ok, great! No problem.

from angularutils.

sjain7200 avatar sjain7200 commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.