Hi Michael! Don't use jQuery and .click(), use a controller, put the function for the click there and put a "ng-click=doSomething()" to the element which should be clickable. If you want to create a custom datepicker (or whatever) write a component).
If you insist on using the $(document).ready and the click events, the $(document).ready will be executed after everything (on the start page) is loaded. The partial can come in later... so you would have to check every x ms if the element is already there, add a click one time and so on. Can get really nasty ;) Am Montag, 3. August 2015 20:43:24 UTC+2 schrieb Michael J. Mahony: > > I am new to Angular and originally had this working when everything was > inside one file. Now I am trying to use partials and i am having problems. > Here is my index page: > > <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" > ng-app="JBenchApp"><head> > <title>Judicial Workbench</title> > <link href="css/bootstrap.css" rel="stylesheet" /> > <link href="css/styles.css" rel="stylesheet" /> > <script > src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script> > <script > src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-route.min.js"></script> > <script src="js/controllers.js"></script> > <script src="js/app.js"></script> > <script src="js/jquery-2.1.4.min.js"></script> > <script src="js/bootstrap.js"></script> > <script src="js/bootstrap-datepicker.js"></script> > <link href="css/bootstrap-datepicker.css" rel="stylesheet" /> > <script> > $(document).ready(function () { > var today = new Date(); > var dd = today.getDate(); > var mm = today.getMonth() + 1; //January is 0! > var yyyy = today.getFullYear(); > > if (dd < 10) { > dd = '0' + dd > } > > if (mm < 10) { > mm = '0' + mm > } > > today = mm + '/' + dd + '/' + yyyy; > $('#datepicker').datepicker({ autoclose: true, startDate: today > }); > $('#theDate').val(today); > var $active = $('#accordion > .panel-collapse.in').prev().addClass('active'); > $active.find('a').append('<span class="glyphicon glyphicon-minus > pull-right"></span>'); > $('#accordion > .panel-heading').not($active).find('a').prepend('<span class="glyphicon > glyphicon-plus pull-right"></span>'); > $('#accordion').on('show.bs.collapse', function (e) { > $('#accordion > .panel-heading.active').removeClass('active').find('.glyphicon').toggleClass('glyphicon-plus > glyphicon-minus'); > > $(e.target).prev().addClass('active').find('.glyphicon').toggleClass('glyphicon-plus > glyphicon-minus'); > }); > $('#accordion').on('hide.bs.collapse', function (e) { > > $(e.target).prev().removeClass('active').find('.glyphicon').removeClass('glyphicon-minus').addClass('glyphicon-plus'); > }); > > $('#firstWarrant').click(function () { > $('#showLogo').hide(); > $('#typeOfCase').html('Warrant - Moritz, Jay'); > $('#warrant1').show(); > $('#warrant2').hide(); > }); > > $('#secondWarrant').click(function () { > $('#showLogo').hide(); > $('#typeOfCase').html('Warrant - Newman, Erika'); > $('#warrant2').show(); > $('#warrant1').hide(); > }); > > $('.navbar-nav li').click(function (e) { > $('.navbar-nav li.active').removeClass('active'); > var $this = $(this); > if (!$this.hasClass('active')) { > $this.addClass('active'); > } > e.preventDefault(); > }); > > }); > </script> > <base href="/" /></head><body ng-controller="JBenchCtrl"> > <nav class="navbar navbar-default navbar-fixed-top"> > <div class="container-fluid black-back"> > <div class="navbar-header"> > <a class="navbar-brand" href="#">Judicial Workbench</a> > </div> > <ul class="nav navbar-nav"> > <li class="active"><a href="#">Calendar</a></li> > <li><a href="#">Min/Mandatory Chart</a></li> > <li><a href="#">Trial Guide</a></li> > <li><a href="#">Calendar Check-in</a></li> > </ul> > <div class="pull-right" ng-show="!loggedin"> > <input type="text" > > ... -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
