Code Monkey home page Code Monkey logo

Comments (4)

jnizet avatar jnizet commented on May 23, 2024

I'm not sure why the template compiler doesn't complain, but you just forgot the square brackets: [autoClose]="false".

from ng-bootstrap.

janwidmer-work avatar janwidmer-work commented on May 23, 2024

@jnizet Thanks for the input.. that was actually just wrong in the Stackblitz.. BUT you still helped me to find out the problem.

It seems that

autoClose="{{false}}" is not working (which I was using in my project)

but

[autoClose]="false" is working

That's a little odd, because in the code example for the option container, they also use the option without square brackents:

image

I Am closing the ticket since it's working when using the correct forma..

from ng-bootstrap.

jnizet avatar jnizet commented on May 23, 2024

@janwidmer-work this is fundamental Angular stuff.

[foo]="bar" is property/input binding. It evaluates the bar Angular expression and sets the the result (which can be of any type) as the value of the property/input foo.

If you use foo="bar", then you pass the string "bar" to the property/input.

foo="{{ bar }}" should never be used. It evaluates the angular expression bar, transforms the result into a string (so in your case, the string "false", and sets bar to that string.

So container="body" is perfectly fine, because we do want to pass the string "body" as input. It's equivalent to [container]="'body'".

But autoClose="false" or autoClose="{{ false }}" are not, because you want to pass the boolean false, and those are passing the string "false".

from ng-bootstrap.

janwidmer-work avatar janwidmer-work commented on May 23, 2024

@jnizet thanks for lighting it up for me and explaining. :)

BR Jan

from ng-bootstrap.

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.