Last post May 09, 2016 11:14 AM by praneeth.wick
May 09, 2016 09:27 AM|sudip_inn|LINK
just see the code from this
http://plnkr.co/edit/O3T7MJuwSvcG04CRvVWB?p=info and must notice this line
var app = angular.module('app', ["ui.bootstrap"]);
just tell me what is ["ui.bootstrap"] ?
when and why people inject this ["ui.bootstrap"] ?
["ui.bootstrap"] is any service or directive or what it would be called ?
May 09, 2016 10:16 AM|praneeth.wick|LINK
AngularJS has a concept call
modules. You can consider a module to be something like a container which will contain/group similar things like controllers/directives/services/etc. When looking at the code below,
Whats happening is you are defining a new module named app. Thats not just it, what is also happening is that, you are saying "ok, in order for my app to work, I also need another module called ui.bootstrap".
So you new app module is dependent on ui.bootstrap module.
UI-Bootstrap is a framework build on top of Bootstrap frameworks CSS library, specifically to target AngularJS, and it contains a collection of controllers/directives/etc grouped in to a module named ui.bootstrap. Hence when you are need
to use the ui.bootstrap with a module you are creating, you would do it like seen in the code above.
May 09, 2016 10:48 AM|sudip_inn|LINK
show me some example of using ui.bootstrap in angular.
ui.bootstrap comes with any directives or controls ?
please redirect me to a tutorial which show how to use various feature of ui.bootstrap in angular js.
May 09, 2016 10:51 AM|sudip_inn|LINK
bootstrap is css framework and css use in html but angular is js framework and we can use bootstrap css in angular view without injecting anything related bootstrap in angular.
so one things is not clear why we need to inject ["ui.bootstrap"] into angular if we need to work with bootstrap css framework in angular view.
please clarify with reason in details. thanks
May 09, 2016 11:14 AM|praneeth.wick|LINK
Answer to you first question: "ui.bootstrap comes with any directives or controls ?"
Yes, Please refer to this link which contains all the directives for UI-Bootstrap with sample code. You can use the blue button "Edit in plunker" for each example to see the entire source
code and how it is being integrated.
Answer to your second quetion: "so one things is not clear why we need to inject ["ui.bootstrap"] into angular if we need to work with bootstrap css framework in angular view"
Bootstrap is mainly CSS, but it does also have components that rely on specific Bootstrap based JS
located here. If you require such behaviour using plain Bootstrap and AngularJS you will need to write a set of custom directives. UI-Bootstrap is the library that is designed to do just this.
However instead of using Bootstrap's JS, UI-Bootstrap has its own implementation of these components in the form of AnugularJS, but the CSS is based Bootstrap's styles.
I hope you got a clear understanding on this.