I'm using AngularJS with requireJS with angularstrap. Right now I simply want to get a datepicker working in my modal box which also uses angularstrap and bootstrap but I keep recieving the error:
Cannot read property 'dates' of undefined
myctrl1.js is the file that downloads datepicker.js and I have all my dependancies in main.js listed. I have never been able to get what should be a fairly simple thing to work so posting here is my last resort.
Plunkr here: LINK
Main files are index.html, controllers.js, myctrl.js
I had the same issue when using jQueryUI. This datepicker is incompatible with jQueryUI datepicker (both use datepicker name), so you should remove jQueryUI from your code or do some namespace workaround.
Perhaps you forgot add bootstrap-datepicker.js on your page. I had same problem and this was solution.
Related
I am using AngularJS v1.6.3 and am trying to find a version of UI.bootstrap that works with it (in terms of Bootstrap's Javascript functionality, such as popover).
This Plunker uses UI.Bootstrap v0.12.0 and the popover works:
http://plnkr.co/edit/6ris13k1kZCGLvO7CP4B?p=preview
This Plunker uses UI.Bootstrap v2.5.0 and the popover does not work:
http://plnkr.co/edit/NS8OLrKXCfKdHrQ8TRwK?p=preview
This is the popover code that does not work in the latter:
<p>Click me and see popover on the right.</p>
I suspect I am doing something wrong. Thanks!
In newer versions of Angular UI Bootstrap, the directive name has been changed from popover to uib-popover. This is a fork of your 2nd Plunker in which the popover is displayed on the right of the link.
You can find the new directive name here
I just started using Angular for university purpose and I wanted to start easy so I just copied some stuff for the official Angular material page into my editor.
(Used bower to install angular-material "bower install angular-material")
This is my code (image, because they don't like HTML code here):
http://imgur.com/pr8YYvN
The button is showing up, but the fancy "click on" animation doesn't work and I cannot see the button description neither!
It was me who add the "." in front of every src/href (the button is not there on the original angular example page, but without the dot, the font won't even be in material style but just standard e.g. Arial)
Where is the problem, did I forget something?
Thanks in advance!
You are using the controller MainCtrl in your application, but you never actually created a MainCtrl in your JS. You also reference YourController in your JS, which is also not declared anywhere.
I recommend to read the error messages angular is giving you in the console.
Can figure out why would that happen. Other directives from ui.bootstrap work: alert, progressbar, etc. Yet popovers and tooltips for some reason stopped working. Anyone had this problem? I had a problem before - when for some reason default css rule for tooltip was opacity:0. But this time a bit different problem. It's not even adding tooltip related stuff to the DOM, as it used to be.
Also I notice from controller of a view where tooltip being used I used to have access to stuff like tt_title, tt_isOpen, tt_placement, etc. Now suddenly I can't do that anymore.
I'm suspecting something to do with browserify we're using. I noticed tooltips not working on my computer first, while on my colleague's they still would work, and then he removed bower files and node_modules, cleaned both npm and bower cache, and tooltips and popovers stopped working for him as well.
I've tried adding ui.bootstrap.tooltip explicitly as a module dependency, although I already have ui.bootstrap listed.
Please, if anyone had similar problems, and know possible solution, help me.
I had the same problem after updating a project from 1.2 to 1.3 and the tool tips stopped working. It seems there is a bug with Angular 1.3. You can read about it here:
https://github.com/angular-ui/bootstrap/issues/2828
I fixed the problem by putting some extra attributes on each tool tip:
<div tooltip="After today restriction" tooltip-trigger tooltip-animation="false" tooltip-placement="bottom">Hover me</div>
I am using 1.3.5 and adding
tooltip-trigger tooltip-placement="top"
Did the trick.
In Angular 1.3.14 and Angular UI Bootstrap 0.11.2, you'll need to include all of the following attributes to make the tooltips work:
tooltip="Edit notifications"
tooltip-trigger
tooltip-animation="false"
tooltip-placement="top"
I was able to make my tooltips start working again by adding the attribute:
tooltip-trigger
...and that was all that I needed. I typically use the same attributes on all of my tooltips, aside from the placement which I tend to alter dynamically for responsiveness.
Although the other responses state that you must use tooltip-placement="top" or tooltip-placement="bottom", I did not find this to be the case. Each tooltip placement is working for me. I am using Angular 1.4.8.
On each of my tooltips I am using:
tooltip-trigger
tooltip-placement="{{tooltip-placement}}"
tooltip="{{tooltip}}"
tooltip-append-to-body="true"
Like I said, adding the tooltip-trigger attribute made it work for me.
I removed the attribute tooltip-append-to-body as a test and my tooltips still work.
In my conclusion, adding tooltip-trigger as a attribute is the fix for this.
Plunker: http://plnkr.co/edit/Sjfb3Esx1NsjwaYGLMGZ?p=preview
Accordion is in the servers tab.
The plunker actually works. My real app does not. The only thing that plunker is not really replicating is the ui-router stuff. On my actual app the accordion won't open. Other questions on SO say that ui.bootstrap is not included and that fixed their problem. I do have ui.bootstrap included though.
I've also tried copying and pasting the example from http://angular-ui.github.io/bootstrap/ that doesn't work either.
I'm at a loss for what else to look for.
More info:
I'm not getting any errors. Also other ui-bootstrap directives work just fine. I'm using tabs on this same page, and modal and dropdown work on other pages.
there is an issue with some version of angular-ui, the js assumes that one atleast one accordion is open and tries to calculate width. But bootstrap hides all accordions. So try displaying one accordion through css, i.e. set the display property of the accordion.
As per my comment:
It's my template. Somehow my template files are out of sync with the js files. In the template it is calling ng-click="toggleOpen()" which does not exist in my code. When I roll that back to ng-click="isOpen = !isOpen" everything works as expected. I need to figure out why my templates and js files are out of sync.
I installed ui-bootstrap using bower which does not include template files. I need to disable template caching during development so I can't use the tpls code. I downloaded the template directory from github and some of the templates simply do not match up with the version of code that bower downloads. I updated the template file to an older version that correctly matches the code from bower. Everything works now.
An example copied directly from
http://angular-ui.github.io/bootstrap/
Does not work at all, neither locally nor in plunker. Don't know why. Bootstrap CSS is loaded, so is ui-bootstrap-tpls.min.js and angular.min.js (angular itself is working just fine though).
Here's the plunker:
http://plnkr.co/edit/15GWWFSUwab4VmaxfFPf
I am getting no js errors in a browser, yet it's not working.
Please help. I need to get this working on my website (i.e. the accordion doesn't work even when I write my own html/js code).
A plunker created from the demo site works flawlessly, just created a plunker from the demo site: http://plnkr.co/edit/z9RQKgNBTRbigyQs7OGW?p=preview
In your plunker you are not declaring dependency on the ui.bootstrap module as described on the very top of the demo page:
As soon as you've got all the files downloaded and included in your
page you just need to declare a dependency on the ui.bootstrap module:
angular.module('myModule', ['ui.bootstrap']);
After adding a dependency on the mentioned module your plunker works as well:
http://plnkr.co/edit/00bK0rNDYIrH9a9TVRk3?p=preview
One more thing - you need at least AngularJS 1.0.5 - there were bugs in earlier versions of AngularJS that prevented this directive from working correctly.