Giter VIP home page Giter VIP logo

Comments (11)

soumak77 avatar soumak77 commented on July 27, 2024

@gfviegas have you tried using the ba-advise directive mentioned in the docs? This directive provides notification support for various states of a component and can be used for more than just modals. This directive is arguable more powerful than promises as you can hookup callbacks in multiple places of your code and not just the one place you created the modal.

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

I do see though that ModalFactory does not currently support adding the ba-advise attribute to the dynamically created modal. Issues #80 has been created to track that.

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

@gfviegas try with v2.0.4 and let me know if you can achieve what you're looking to do

from angular-base-apps.

gfviegas avatar gfviegas commented on July 27, 2024

@soumak77 another GREAT feature is to use the Controller to link to modal. What the plugin does is basically adapt the ZFA modal to be a little bit like AngularUI Bootstrap Modal.. See https://angular-ui.github.io/bootstrap/

This way we can create stateful modals, and put the modal logic in its own file.

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

@gfviegas You should be able to accomplish what you need with the contentScope config property of the ModalFactory

from angular-base-apps.

gfviegas avatar gfviegas commented on July 27, 2024

@soumak77 Can I link a controller name into the contentScope?

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

@gfviegas no that is not currently possible

from angular-base-apps.

gfviegas avatar gfviegas commented on July 27, 2024

@soumak77 that's what I was referring to. So for me it's missing 2 big functionalities that exists in the plugin I linked:

  • Resolve the modal with a success data or dismissing it with a error data promise-like.
  • Bind a modal to a Controller.

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

I wouldn't be opposed to having the ModalFactory return promises for the following methods:

  • activate
  • deactivate
  • toggle

Currently those methods don't return anything, so having them return a promise won't break backwards compatibility.

Support can also be added to the ModalFactory to allow providing a controller instead of a contentScope.

Feel free to submit PRs for either of those features.

from angular-base-apps.

gfviegas avatar gfviegas commented on July 27, 2024

I dont really know how the source works, but I'll study and submit my PR. For now, I asked help for the plugin creator so we can have more resources to work on top of it.. Thanks bro @soumak77 !

from angular-base-apps.

soumak77 avatar soumak77 commented on July 27, 2024

@gfviegas I'm going to close this but feel free to add a PR for the desired support

from angular-base-apps.

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.