Giter Club home page Giter Club logo

Comments (15)

akserg avatar akserg commented on August 20, 2024

Hi Tom

Can you elaborate:

  1. the folders structure of the project?
  2. the content of new window.html file?

Regards,
Sergey.

On 10 March 2014 19:26, Tom [email protected] wrote:

Hi!
I see, for things like the modal window component, you can pass the
template or templateUrl for the content within the modal window
(window.html's content area)...but I'd also like to be able to pass the
template URL for window.html itself.

My project sits inside another site/project and since modal.dart has
packages/angular_ui/modal/window.html but I actually need it as
/packages/angular_ui/modal/window.html to work.

Perhaps as simple as passing the an attribute to
itself? I know there's two templates here
and to make it less confusing the developer should only need to pass what
they want inside the actual modal...I hear that, but in special
circumstances here, one may have the need to path the window.htmltemplate (among other internal templates I suppose) differently...Or
completely replace it.

Perhaps this is already possible in some way that I'm not clearly
understanding as well. Any thoughts on this issue would be appreciated.
Thanks!

Reply to this email directly or view it on GitHubhttps://github.com//issues/47
.

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

In my case the window.html file remains unchanged. I just needed to prepend a / on there (to the path for the actual templateUrl). However, if I wanted to change the HTML structure of that modal window (say Bootstrap updates or something)... I couldn't as is... At least I don't think I can.

from angular.dart.ui.

akserg avatar akserg commented on August 20, 2024

We will update the code because Bootstrap will changed in future. You don't
need to worry about that.
I confused about folders structure of your project. The 'packages' folders
usually exists in root of application and it follows you requirements. What
the real problem do you have? Would you show example?

On 10 March 2014 22:51, Tom [email protected] wrote:

In my case the window.html file remains unchanged. I just needed to
prepend a / on there. However, if I wanted to change the HTML structure of
that modal window (say Bootstrap updates or something)... I couldn't as
is... At least I don't think I can.

Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-37232645
.

from angular.dart.ui.

zoechi avatar zoechi commented on August 20, 2024

I haven't tried it myself but I think this can be used to accomplish what
you want:
https://github.com/angular/angular.dart/blob/master/lib/directive/ng_template.dart

This should work to replace the default template with a custom one.
As far as I know it works this way:

  • check the cache if the template is there
  • if not load it from the server
  • when ng-template loads a template for a specific URL into the template
    cache before the default behavior takes place, this template should be used
    instead.

I could be completely wrong though (as I said I never actually used it
myself).
If it doesn't work just create a question on StackOverflow.

There was also a StackOverflow question about a similar use case
http://stackoverflow.com/questions/20890392

I also don't know the modal component, so the comments/suggestions from
Sergey may be a better answer.

Cheers
Günter

Mit freundlichen Grüßen

Günter Zöchbauer
[email protected]
+43 (699) 10 18 87 15

On Tue, Mar 11, 2014 at 5:41 AM, Sergey Akopkokhyants <
[email protected]> wrote:

We will update the code because Bootstrap will changed in future. You don't
need to worry about that.
I confused about folders structure of your project. The 'packages' folders
usually exists in root of application and it follows you requirements. What
the real problem do you have? Would you show example?

On 10 March 2014 22:51, Tom [email protected] wrote:

In my case the window.html file remains unchanged. I just needed to
prepend a / on there. However, if I wanted to change the HTML structure
of
that modal window (say Bootstrap updates or something)... I couldn't as
is... At least I don't think I can.

Reply to this email directly or view it on GitHub<
https://github.com/akserg/angular.dart.ui/issues/47#issuecomment-37232645>

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-37262864
.

from angular.dart.ui.

akserg avatar akserg commented on August 20, 2024

I didn't try these solutions myself, but Tom can use that solution and
others if he wants.
Just try and let us know.

On 11 March 2014 11:49, Günter Zöchbauer [email protected] wrote:

I haven't tried it myself but I think this can be used to accomplish what
you want:

https://github.com/angular/angular.dart/blob/master/lib/directive/ng_template.dart

This should work to replace the default template with a custom one.
As far as I know it works this way:

  • check the cache if the template is there
  • if not load it from the server
  • when ng-template loads a template for a specific URL into the template
    cache before the default behavior takes place, this template should be
    used
    instead.

I could be completely wrong though (as I said I never actually used it
myself).
If it doesn't work just create a question on StackOverflow.

There was also a StackOverflow question about a similar use case
http://stackoverflow.com/questions/20890392

I also don't know the modal component, so the comments/suggestions from
Sergey may be a better answer.

Cheers
Günter

Mit freundlichen Grüßen

Günter Zöchbauer
[email protected]
+43 (699) 10 18 87 15

On Tue, Mar 11, 2014 at 5:41 AM, Sergey Akopkokhyants <
[email protected]> wrote:

We will update the code because Bootstrap will changed in future. You
don't
need to worry about that.
I confused about folders structure of your project. The 'packages'
folders
usually exists in root of application and it follows you requirements.
What
the real problem do you have? Would you show example?

On 10 March 2014 22:51, Tom [email protected] wrote:

In my case the window.html file remains unchanged. I just needed to
prepend a / on there. However, if I wanted to change the HTML
structure
of
that modal window (say Bootstrap updates or something)... I couldn't
as
is... At least I don't think I can.

Reply to this email directly or view it on GitHub<

https://github.com/akserg/angular.dart.ui/issues/47#issuecomment-37232645>

.

Reply to this email directly or view it on GitHub<
https://github.com/akserg/angular.dart.ui/issues/47#issuecomment-37262864>

.

Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-37278319
.

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

Ok, cool. So this will basically let me define the template for any directive? That'll work. I didn't realize that value could be set from outside the directive/component itself. I'll give this a try soon here.

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

Sorry it took me a while to try this...But I can't seem to make it work. I've tried ng-template="/path/to/template.html" as well as type="text/ng-template" id="/path/to/template.html" and neither seemed to work.

Though this is exactly what I'd be looking for in the <modal-window> directive - some sort of attribute that could be set to change the template. I just don't think the NgTemplate directive will do it. It unfortunately only seems to only work on <template> and <script> elements.

In my compiled JavaScript, I found that I only have two places to add a slash...So it's not a huge issue, but it adds an extra step to deployment that's easy to forget.

from angular.dart.ui.

zoechi avatar zoechi commented on August 20, 2024

Did you also try the URL rewrite solution from the linked StackOverflow question?

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

Trying...but having trouble. It can't seem to find the rewriter class I setup (following along with the example it is actually called MyUrlRewriter). I've put it in the Injectables constants as well and have re-run the generators. It just says Uncaught Unsupported operation: Cannot find class for: MyUrlRewriter

from angular.dart.ui.

zoechi avatar zoechi commented on August 20, 2024

Did you add MyUrlRewriter to your module? type(MyUrlRewriter)

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

Yes, with:

class MyAppModule extends Module {
  MyAppModule() {
    type(UrlRewriter, implementedBy: MyUrlRewriter);
...

from angular.dart.ui.

zoechi avatar zoechi commented on August 20, 2024

Can you make the application (stripped down if possible) available on a GitHub repo than I could take a look.

from angular.dart.ui.

akserg avatar akserg commented on August 20, 2024

Hi Tom.
Is you question still actual for you?

from angular.dart.ui.

tomsonar avatar tomsonar commented on August 20, 2024

I'd have to update my project to see. It's been a while since I've worked with it, though this is bug fix week for me and I should be working with it again. I'll post back if this is still and issue, but if you want to close it you can.

I'd still like to see more flexibility in the template pathing though. I think a simple attribute to change that would be a lot better than using some hack with the UrlRewriter.

from angular.dart.ui.

akserg avatar akserg commented on August 20, 2024

Ok. I close that issue.

If you problem still exists - let me know.
Don't forget attach reference on source code if it publicly available or send issue with code snippet so we can talk more constructive.

Regards,
Sergey.

from angular.dart.ui.

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.