Giter Site home page Giter Site logo

Comments (4)

voronianski avatar voronianski commented on August 19, 2024

@akempes from element's id property, they are added to the dialog <div id="ngdialog1"...

from ngdialog.

akempes avatar akempes commented on August 19, 2024

@voronianski Thanks but I would like to access/store the ID in the controller that is issuing the dialog.

For now I added after:

globalID += 1;

this line:

this.latest = 'ngdialog' + globalID;

Using it like this:

ngDialog.open({ 
    template: 'myTemplate.html', 
    controller: 'myController'
});

console.log(ngDialog.latest);

from ngdialog.

voronianski avatar voronianski commented on August 19, 2024

@akempes yeah, nice suggest, it can be added to the library asap I think..

for now id can be taken only from element, so it's not that useful in controllers.. I think it will be fine to return an instance of dialog with .open, so it might look like:

var dialogOne = ngDialog.open();

ngDialog.close(dialogOne.id); // or even dialogOne.close();

from ngdialog.

voronianski avatar voronianski commented on August 19, 2024

@akempes in latest 0.1.3 version you're able to get id from $result property -

var $dialog = ngDialog.open({ ... }).$result;
$dialog.attr('id'); // returns opened dialog id

from ngdialog.

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.