Giter VIP home page Giter VIP logo

angular-confirm's People

Contributors

almeidap avatar devakone avatar filti avatar jameskleeh avatar jcford73 avatar kerchuma222 avatar melnikaite avatar rbanks54 avatar simison avatar stguitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-confirm's Issues

returning a user-selected value from $confirm

First, let me thank you for writing a good directive/service that is simple to use---solves 95% of my need for dialog boxes.

However, I have one use-case where I have this in my controller

$scope.name="Anne";
$scope.showTemplatedService = function()
{
    var data1 = {list: ["Anne","Betty","Cathy"] };
    $confirm( data1, {templateUrl: 'dialog.html'})
        .then(function() {
            alert("You selected "+ $scope.name  );
        });
}

and in a html file

...
<script type="text/ng-template" id="dialog.html">
...
    <select ng-model="name">
            <option ng-repeat="item in data.list" value="{{item}}">{{item}}</option>
    </select>
    <div id="selected"> {{name}} </div>
</script>

I can see the selection I make in the div in the dialog box after I make a selection, but how do I get that value in the promise in the controller?

Thanks in advance.

CSS problems

I get this when including and using angular-confirm - http://imgur.com/IDyUO0O

I'm sure this is because of some existing CSS but i'm not good enough at CSS to debug it. Are there any easy methods you're aware of that I can use to get this working without tiring CSS debugging?

$modal is now deprecated. Use $uibModal instead.

Hello.

Angular UI (version: 0.14.3) have changed the naming convention of their services. They prefix them with 'uib' now.

Could you please make this change on your library as well so we stop getting the deprecation warning whenever we use it?

Thanks in advance.

When uglyfied : Unknown provider: eProvider <- e <- $confirm <-

Hello!

So I have found a small issue in your library.
I build my application using normal sources and minify/uglyfy it all together with my app.

After minification I encountered error described here:
https://docs.angularjs.org/error/$injector/unpr?p0=eProvider%20%3C-%20e%20%3C-%20$confirm%20%3C-

A quick googling gave me this hint: http://stackoverflow.com/questions/13459452/rails-3-angularjs-minification-does-not-work-in-production-unknown-provider

And so I have found in your code the missing parts:

.controller('ConfirmModalController', function ($scope, $uibModalInstance, data) {
(...)
.factory('$confirm', function ($uibModal, $confirmModalDefaults) {
(...)
.directive('confirm', function ($confirm, $timeout) {

they should look like this:

.controller('ConfirmModalController', ['$scope', '$uibModalInstance', 'data', function ($scope, $uibModalInstance, data) {
(...)
.factory('$confirm', ['$uibModal', '$confirmModalDefaults', function ($uibModal, $confirmModalDefaults) {
(...)
.directive('confirm', ['$confirm', '$timeout', function ($confirm, $timeout) {

But later I noticed you are using ngAnnotate = require('gulp-ng-annotate'), in your build script.

However if you want it to work properly you need to follow this guidelines:
https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#minification-and-annotation

I can fix it and present a pull-request if you prefer.

Option to pass Data without copying it

Would like an option to pass data to Angular-Confirm without copying it. This would allow the ability to have inputs on the confirmation modal that can update the calling parent scope.

TemplateURL changes all dialogs

Setup two confirm enabled buttons (One requires a typed 'signature', the other does not). Use a custom templateURL for the first. Allow the default for the second.
Click the second button. The proper dialog (default) appears. Click the first button, the proper dialog appears (custom). Click the second button again, the wrong dialog (custom) appears.

Missing angular-confirm.min.js by installing via npm

Hi, James. You developed this wonderful module, thank you so much, dude. But we are confused by some strange things:

  1. there's a line in package.json:
"main": "angular-confirm.min.js"
  1. but! in .gitignore you specified same file - angular-confirm.min.js

By installing this module via npm we have a problem: module does not contain angular-confirm.min.js because of .npmignore which totaly matches with .gitignore. Could you please update the package in npm providing an appropriate .npmignore (which wouldn't contain angular-confirm.min.js).

We've got this error because of missing angular-confirm.min.js:

Module not found: Error: Cannot resolve module 'angular-confirm'

Conflicts with ui.bootstrap.tooltip

Firstly, thanks for the module. Works great.

I just noticed that when I use Angular Bootstrap Tooltip on the same element, the confirm doesn't work anymore. For example this works fine:

<img src="img/trash.png" ng-click="delete()" confirm="Are you sure to delete?" confirm-settings="{size: 'sm'}" />

but when I add the tooltip the dialog doesn't pop up:

<img src="img/trash.png" ng-click="delete()" uib-tooltip="Delete list" confirm="Are you sure to delete?" confirm-settings="{size: 'sm'}" />

Thanks,
Volkan

$confirm is undefined is not a function

Hi!

I did all steps like yours site, but when the $confirm is invoke throw a exception with message "undefined is not a function".

I dont know why $confirm doesnt work.

Thanks

option to don't display the confirm modal

I look in the closed issues but don't found a help.

I made an interface with a list of button. on each button there is a confirm with yes/no.
http://awesomescreenshot.com/0465v52t3e

there is a lot of button so if the user needs to click 10 of them, the confirm message will be boring after 2/3 times.
Is there a way to display inside the confirm modal a button to "ok i understand, stop showing confirm" so on other button click confirm will not show.

It is on same idea that how modern web browser handle popup .

thanks

How to apply conditional confirm?

currently i am using directive like : confirm="Are you sure?"

But what if i want to confirm if certain condition is true.

Can you please help.

Unable to deploy to WebJars

Hi,

I'm trying to deploy version 1.2.1 to http://www.webjars.org/bower.
I'm getting the following error:

Failed! No valid licenses found. Detected licenses: Apache The acceptable licenses on BinTray are at: https://bintray.com/docs/api/#_footnote_1 License detection first uses the package metadata (e.g. package.json or bower.json) and falls back to looking for a LICENSE, LICENSE.txt, or LICENSE.md file in the master branch of the GitHub repo. Since these methods failed to detect a valid license you will need to work with the upstream project to add discoverable license metadata to a release or to the GitHub repo. If you feel you have reached this failure in error, please file an issue: https://github.com/webjars/webjars/issues Created Bower WebJar Fetched Bower zip Generated POM Converted dependencies to Maven Got Bower info Determined Artifact Name: github-com-Schlogen-angular-confirm Starting Deploy
Deploy!

When trying to use an additionalTemplate it fails

The code as it sits ends up deleting a template ( because it's trying to use templateUrl )

This is because the check which is supposed to confirm existence of templateUrl is code in correctly. Specifically line 63 checkout for 'templateUrl' in settings which returns true even if the field has a value of undefined. A more appropriate check would be just settings.templateUrl which will return false in the case of undefined

Conflict with Angular-Strap

Since the module requirement is the whole of ui-bootstrap, this creates conflicts if you're also using Angular Strap. Could the ui-bootstrap dependency reduced to only those modules needed for the modal?

Jasmine + Karma + $Confirm

Hello,

I'm trying to unit test a delete method that prior to deleting the entity uses $confirm to query the user if he really wants to delete the entity.

Any ideas on how to mock the $confirm?

Cheers

Error: [$injector:unpr] Unknown provider: $modalProvider <- $modal <- $confirm

Hello,
Thanks for this wonderful plugin. I am having issues using the plugin. Anytime i included the 'angular-confrim' module in my App.module, i get the error below

Error: [$injector:unpr] Unknown provider: $modalProvider <- $modal <- $confirm
Here's my App module config
var App= angular.module('escrow',['datatables','datatables.bootstrap','ngRoute','datatables.buttons','angular-confirm','ui.bootstrap'])

And here is my controller
App.controller('BankMerchantListCtrl',function($scope, $compile, $confirm, $uibModal, DTOptionsBuilder, DTColumnBuilder,BankService) {

Add Support to Act Like JS Confirm()

This should have similar functionality to confirm() in JS

A Boolean, indicating whether "OK" or "Cancel" was clicked in the dialog box:
true - the user clicked "OK"
false - the user clicked "Cancel" (or the "x" (close) button in the top right corner that is available in all major browsers, except Firefox)

Example:

if (document.getElementById("back-button").disabled ||
$confirm({title:'',text: "The 'Back' button will be disabled if a field " +
"name is changed. Press 'OK' to confirm.", ok: 'OK', cancel: 'Cancel'}) == true)

I have read your documentation and do not see an example like this.

Event propagation stop

Event propagation can not be stopped.
If $event.stopPropagation() is called in ng-click expression, it is not called right on click but upon dialog is closed and at that point event is already propagated.

Current workaround:
wrap your element with element which has ng-click="$event.stopPropagation()".

minified version

Could we please get a minified version of the file included in the package?

things in template pass to the $confirm?

I am in trouble with use templateUrl which includes angular validation(the original),and i want to pass Form.$valid to the confirm dialogo function ok but it didn't work in the controller with then(function(isValid){console.log(isValid)})....or is there any way to link submit action to this ok function ...
much appreciations if you can deal with it cause i am a new one in angular js....

Add instructions for bower install

Name of git repo would lead one to believe that bower install angular-confirm would work. This is wrong repo / library however.

bower install angular-confirm-modal works.

How to use with template

Hello,

Do you have a fully sample with a custom template file ?

I don't understand where to insert the $uibModal service.

block user to click outside the confirm modal

Actually if the user click outside the $confirm modal it does the same thing as clicking cancel.
Is there a way to force the user to click only on "ok" or "no" button and make click outside the modal do nothing ?

$modal get an option to do this backdrop: 'static' but i don't know how to use it here ( i use $confirm as service in controller )

backdrop - controls presence of a backdrop. Allowed values: true (default), false (no backdrop), 'static' - backdrop is present but modal window is not closed when clicking outside of the modal window.

For example:

$modal.open({ templateUrl: 'myModalContent.html', controller: ModalInstanceCtrl, backdrop: 'static' })

Confirmation within another modal

Do you have any examples of using this from within another modal? I'm still new to angular, so I may be missing something quite simple, but I'm getting an injection error after following your example.

I have a view that itself will open a modal to allow for data entry. It's a pretty standard setup... form fields, and clicking okay will save the information. Cancel will cancel everything.

There's set of fields that dynamically repeat and they each have a button that will delete a set, if needed. In that function, I'm using the service method of calling your plugin.

I've included the reference in my controller like your example says.

codeCampApp.controller("AddSpeakerModalController", ["$scope", "$rootScope", "$modalInstance", "$confirm", "codeCampServiceFactory", function ($scope, $rootScope, $modalInstance, $confirm, codeCampServiceFactory) {

And then I included the confirm within the OK click function.

$scope.RemoveSession = function (session) {

    if (session.SessionId > 0 || (session.Title.length > 0 || session.Description.length > 0)) {
        $confirm({ text: 'Are you sure you want to delete this session?' })
            .then(function () {
                if (session.SessionId > 0) {
                    // call a web service to delete the session server-side
                }

            return;
        });
    }

    var index = $scope.sessions.indexOf(session);
    $scope.sessions.splice(index, 1);
}

But I get this error when I click on the button to open the original (my) modal:

Error: [$injector:unpr] Unknown provider: $confirmProvider <- $confirm <- AddSpeakerModalController

image

Can you help me?

Conflicting with the class of another modal

I'm using $confirm inside angular-ui's uibModalInstance and it's updating with the class of already opened modal. I'm using custom css class modal-wide in parent div of modal-dialog in first modal.

Before $confirm modal

After $confirm modal open ( first modal's width back to medium as $confirm modal removed the modal-wide class )

Feature to allow custom bootstrap classes for the OK/Cancel buttons

We sometimes use confirm dialogs in more of a "negative" context, where dismissing the dialog warrants a 'danger' class for the button.

I have created the ability to pass in the desired bootstrap button class to the directive for each of the OK and Cancel buttons.

I have pull requested this, but let me know if this isnt the process that you prefer, or if you want to ignore it entirely.

Thanks!

Unable to inject

Using Angular 1, Typescript, Jade, installed via bower

Error: [$injector:strictdi] function($confirm, $timeout) is not using explicit annotation and cannot be invoked in strict mode
http://errors.angularjs.org/1.4.7/$injector/strictdi?p0=function(%24confirm%2C%20%24timeout)
at processor.js:61
at Function.annotate as $$annotate
at Object.invoke (processor.js:61)
at processor.js:61
at forEach (processor.js:61)
at Object. (processor.js:61)
at Object.invoke (processor.js:61)
at Object.enforcedReturnValue as $get
at Object.invoke (processor.js:61)
at processor.js:61

$uib prefixes

Consider adding the prefix "$uib" to make it compatible with new bootstrapUi

WARNING: Tried to load angular more than once.

Hello there,

when I include the angular-confirm.min.js file in my index.html and then inject it into my main.js file, then I get the following warning shown in my console:

WARNING: Tried to load angular more than once.

Any Idea, why this warning is thrown?

Regards

How call a custom trigger to dismiss a modal?

I need call a scope function when the dismiss modal is called.
Eg: When i click 'delete' action, a 'highlight' class is added to the row clicked then $confirm service is called, but when i dismiss the modal, i want remove this class.

Some ideia, to resolve this?

  $scope.selectedRow = null; 
    $scope.delete = function (item) {
        $scope.selectedRow = item.id;  //need set this to null when modal dismiss

        $confirm('Deseja realmente excluir este registro?')
            .then(function() {
                resource.delete(item.id).then(function (r) {
                  var index = $scope.items.indexOf(item);
                    $scope.items.splice(index, 1);
                });
            });
    }

Handle internationalization in default settings

It's possible to define default settings with the following

.run(function($confirmModalDefaults) {
$confirmModalDefaults.templateUrl = 'path/to/your/template';
$confirmModalDefaults.defaultLabels.title = 'Modal Title';
$confirmModalDefaults.defaultLabels.ok = 'Yes';
$confirmModalDefaults.defaultLabels.cancel = 'No';
})

How to handle internationalization ( $confirmModalDefaults.defaultLabels.ok = 'Oui' for french for instance)

HTML Support in message

Hey,

I was trying to make the message look like "Are you sure to delete Bob?". However the message there doesn't seem to be a HTML support in angular-confirm.

I love this little Angular plugin and would appreciate if there is a way to put in some HTML into the message.

Thanks,
Raghu

Hi guys,

I am trying to use angular-confirm with requirjs but when I clikc the button nothing happens. IF I use it without Requirejs it work

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.