Git Product home page Git Product logo

Comments (10)

slavafomin avatar slavafomin commented on July 19, 2024

Hello @Mr-Negative!

Thank you for an interest in this module. However, I'm not sure I understood your use case and the problem. Could you please create a Plunk to demonstrate the issue? You can start with this: http://plnkr.co/edit/g2MDXv81OOBuGo6ORvdt?p=preview

Then I will be glad to dig into it and will try to help you.

Cheers!

from angular-input-modified.

Mr-Negative avatar Mr-Negative commented on July 19, 2024

http://plnkr.co/edit/2NxkIWQnqOOyXjMTdVw3?p=preview when you change value on " Form modified:" input it will trigger alert. when input will change by writing in full name input - it won't

from angular-input-modified.

slavafomin avatar slavafomin commented on July 19, 2024

I see. But, why do you need to bind modification state via ngModel and monitor it via ngChange? What are you trying to achieve in the end?

from angular-input-modified.

Mr-Negative avatar Mr-Negative commented on July 19, 2024

First of all im new in angular so maybe question is stupid;-). i have form that is created in modal, and when i click "ok" button i need have information in parent if it was modified. In Your examples you disable save button, i need it to return this data from model to function "ok". if i would do ng-click="ok({{variation_form.modified}})" it generates Error: [$parse:syntax] Syntax Error: Token 'variation_form.modified' is unexpected, expecting [:] at column 6 of the expression [ok({{variation_form.modified}})] starting at [variation_form.modified}})].

from angular-input-modified.

slavafomin avatar slavafomin commented on July 19, 2024

It looks like you've found a very weird way to solve this problem. First of all look at some good module for dialogue windows. Like this one: http://likeastore.github.io/ngDialog/#. Your modal form will run inside of an isolated dialogue scope. You could pass any data from this scope to your parent application via promises. Look at this: https://github.com/likeastore/ngDialog#scopeclosethisdialogvalue.

from angular-input-modified.

Mr-Negative avatar Mr-Negative commented on July 19, 2024

thx. i'm working on somebody elses code so i can't use this dialog.module but i found workaround and in next projects i will use this module. Thanks for help.

from angular-input-modified.

slavafomin avatar slavafomin commented on July 19, 2024

@Mr-Negative sure thing. The approach should be the same with any other dialogue module if it supports at least the minimal functionality.

from angular-input-modified.

Mr-Negative avatar Mr-Negative commented on July 19, 2024

It was written by this "dev" :-/. But i have one question "around this". Is it possible to attach maybe some watch or something like this to modified value at all? it would be usefull for an example triggering custom validators for whole form only when modified

from angular-input-modified.

slavafomin avatar slavafomin commented on July 19, 2024

You should be able to add watches standard way, e.g.: $scope.$watch('formName.modified', onFormModified); or $scope.$watch('formName.fieldName.modified', onFieldModified);.

from angular-input-modified.

Mr-Negative avatar Mr-Negative commented on July 19, 2024

Hi i found answer so i put it here so maybe somebody else find this post and find it usefull. $watch doesnt work well with modals [ui-bootsrap ones] becouse of isolated dialogue scope. But if you do something like this - https://gist.github.com/rnkoaa/8333940 it would work on this plugin also.

Most important bit is to name it like this "form.userForm" and
var ModalInstanceCtrl = function ($scope, $modalInstance, userForm) {
$scope.form = {}

thx for help and this amazing plugin

from angular-input-modified.

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.