I've got a problem employing angular-ui Bootstrap in my project. Namely dropdown directive.
By now i have HTML that is just a copy-paste from the examples:
<ul>
<li class="dropdown">
<a class="dropdown-toggle"> Drop!</a>
<ul class="dropdown-menu">
<li> one </li>
<li> two </li>
</ul>
</li>
</ul>
When Angular compiles HTML this error is thrown for each dropdown i have on the page:
TypeError: Object [object Object] has no method 'parent'
at link (http://localhost:3000/vendor/ui-bootstrap-tpls-0.7.0.js:1316:15)
at nodeLinkFn (http://localhost:3000/vendor/angular/angular.js:6124:13)
at compositeLinkFn (http://localhost:3000/vendor/angular/angular.js:5536:15)
at compositeLinkFn (http://localhost:3000/vendor/angular/angular.js:5539:13)
at compositeLinkFn (http://localhost:3000/vendor/angular/angular.js:5539:13)
at compositeLinkFn (http://localhost:3000/vendor/angular/angular.js:5539:13)
at compositeLinkFn (http://localhost:3000/vendor/angular/angular.js:5539:13)
at publicLinkFn (http://localhost:3000/vendor/angular/angular.js:5444:30)
at boundTranscludeFn (http://localhost:3000/vendor/angular/angular.js:5555:21)
at controllersBoundTransclude (http://localhost:3000/vendor/angular/angular.js:6145:18) <a class="dropdown-toggle">
This line binds click event on a.dropdown-toggle parent (that is li.dropdown obviously).
What am i doing wrong? I've lost more than three hours trying to solve this and still have no idea what can cause this error.
p.s. HTML is compiled from Jade, and i use Bootstrap 3, but i hope that's not the point this time.
UPD: as Nix asked, i include head and app.js
head
title= title
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1')
link(rel='stylesheet', href='/vendor/bootstrap/css/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/client/main.css')
script(src='/vendor/jquery-1.10.2.min.js', type='text/javascript')
script(src='/vendor/angular/angular.js', type='application/javascript')
script(src='/vendor/angular/angular-route.js', type='application/javascript')
script(src='/vendor/ui-bootstrap-tpls-0.7.0.js', type='text/javascript')
script(src='/angular/client/app.js', type='text/javascript')
script(src='/angular/client/menu/controllers.js', type='text/javascript')
//a lot of other app stuff...
it's app.js
var app = angular.module('clientApp',[
'ngRoute',
'menuControllers'
]);
it's menu controllers
var menu = angular.module('menuControllers', [
'sharedModels',
'ui.bootstrap'
]);
menu.controller('menuCtrl', ['$scope', 'categoriesModel', 'subcategoriesModel', menuCtrl]);
and the full source of menu.jade. it's included to body ng-app='clientApp'
div.container(ng-controller='menuCtrl')
div(ng-repeat='cat in categoriesModel')
div.btn-group
a.btn.btn-default(href='#!/category/{{cat._id}}') {{cat.name}}
ul
li.dropdown
a.dropdown-toggle Dropdown
ul.dropdown-menu(ng-repeat='subcat in subcategoriesModel')
li: a(ng-href='#!/subcategories/{{subcat._id}}') {{subcat.name}}