Git Product home page Git Product logo

Comments (4)

YousefED avatar YousefED commented on August 12, 2024

This page has an example: https://github.com/YousefED/ElasticUI/blob/master/docs/components.md (see euiFilter).

The scope is an inherited scope, and from code within the same scope (e.g.: child elements) you can modify the value. In the example ngModel is used to bind to scope.filter.enabled

from elasticui.

mastermind1981 avatar mastermind1981 commented on August 12, 2024

May be my question wasn't clear enough : my goal to enable/disable the enabled flag from parent controller. I don't know if it is possible or not.

I created a variable in the parent controller scope (the controller of the view containing the filter directive) which will be used to set the enabled flag on the filter, i have call it enableXFilter .

And i have used it like this:

 <label class="btn " ng-change="filter.enabled = enableXFilter " ng-model="enableXFilter"
                eui-filter="ejs.TermFilter('field','value')"  btn-checkbox>

When the button is checked enableXFilter and filter.enabled are correctly setted. But the problem is that the enableXFilter in the parentController scope isn't impacted. Actually, it's a scoping a problem, but i thought that eui-filter directive uses scope =true inherited scope and it will use the enableXFilter declared within the parent scope variable.

Am i missing something in my approach?

from elasticui.

YousefED avatar YousefED commented on August 12, 2024

Isn't this the famous angular issue with changing primitive variables? Try declare enableXFilter on an object, e.g. ng-model="wrapper.enableXFilter" etc.

from elasticui.

mastermind1981 avatar mastermind1981 commented on August 12, 2024

Good eye!! it works شكرا جزيلا

from elasticui.

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.