Tagged Questions
15
votes
3answers
2k views
Angular ui-router scroll to top, not to ui-view
I've just upgraded to ui-router 0.2.8 from 0.2.0 and I've noticed that when the state changes, the scroll position jumps to the top of te child ui-view that is the subject of the new state.
This is ...
8
votes
3answers
8k views
AngularJS retrieve data via AJAX before Directive runs
I'm using AngularUI's uiMap directives to instantiate a google map. The uiMap directive works great with hard-coded data ({mapOptions} and [myMarkers]); however I run into trouble when I retrieve this ...
7
votes
2answers
16k views
Angularjs UI Modal Forms
I used to have a login dialog using bootstrap modal:
$scope.loginDialog = {
backdrop: true,
keyboard: true,
windowClass: "modal loginDialog",
backdropClick: true,
templateUrl: ...
7
votes
2answers
2k views
angular ui modal after close event
Is there a way I can call a function after a modal window got called (no matter if it happened with a button or by clicking on the backdrop)
var dialog, options;
options = {
windowClass: ...
7
votes
3answers
2k views
Can't select item in list created by ui-select2
In my HTML I have this line:
<input ng-change="privChanged()" ng-model="selectedPriv" ui-select2="privsSelect2options"></input>
and the privsSelect2options function:
...
7
votes
2answers
2k views
Angular ngGrid select row on page load
My question is an extension to thisquestion
Getting select rows from ng-grid?
plunker - http://plnkr.co/edit/DiDitL?p=preview
I need a row to be selected on page load and I need to avoid listening ...
6
votes
6answers
3k views
How to make Automated Dynamic Breadcrumbs with AngularJS + Angular UI Router
One key component to web applications is breadcrumbs/navigation. With Angular UI Router, it would make sense to put the breadcrumb metadata with the individual states, rather than in your controllers. ...
6
votes
1answer
984 views
set angular-ui-tinymce editor content after navigation
I'm using angular-ui-tinymce (latest version 0.0.4, https://github.com/angular-ui/ui-tinymce/blob/master/src/tinymce.js).
I've encountered a problem I cannot solve.
On the first page load, content ...
6
votes
1answer
2k views
angularUI ui-select2 directive not working
I've been banging my head against the wall with this, so I've reduced it to the bare minimum:
index.html:
<html lang="en" ng-app="myApp">
<body ng-controller="main">
...
6
votes
1answer
247 views
Angular UI Router animation on parent view
I have a nested state like:
.state('contacts', {
url: '/contacts',
views: {
'': {
templateURL: 'views/contacts.html',
contacts: 'ContactsCtrl'
}
}
...
6
votes
2answers
3k views
angular-ui select2 initSelection not getting called
I have an angular-ui select2 component on my page. It works fine when the user types something in (it uses ajax to load in the data).
But the initSelection function never gets called. Here's the ...
6
votes
1answer
1k views
angularjs ui-sortable: cannot call methods on sortable prior to initialization; attempted to call method 'refresh'
I'm trying to do sorting list, I take the element from the db but...
Error: cannot call methods on sortable prior to initialization; attempted to call method 'refresh'
My html:
<div ...
5
votes
4answers
8k views
Angularjs Form/Field validation using JavaScript function without directives
Is there a way to validate a field in angular without using a directive?
For example: I want to make following validation on an input field.
If field is empty we should show "Field must contain a ...
5
votes
1answer
11k views
AngularJS: How to validate date in US format?
I have the following form code that allows input of a date using AngularUI (date is required and should match US date format e.g.: MM/DD/YY):
<form name="form" ng-submit="createShipment()">
...
5
votes
1answer
3k views
how to inject $scope object to the dialog template?
I have this plunker with a dialog example that uses the resolve attribute of the option object, based on this example.
Basically what I want to do is to pass the title variable to be used in the ...
5
votes
3answers
3k views
angular ui sortable callback
Is there a way to set a callback function with angular ui's sortable? I'd like to add ng-update="foo()" to the tbody tag below and have foo run whenever the list changes.
<tbody ...
5
votes
1answer
930 views
Angular UI-router default state on same URL
This is going to be difficult to explain but I'll try.
I am using UI-router in an angular app and would like t use the following URLS:
/contacts
/contacts/{id}
When you visit the /contacts page it ...
5
votes
1answer
1k views
How to add jquery to jasmine/angularjs unittests
I have a project which is builded on plain angular.js code. We creates unittest with jasmine. But now we need to grab some 3rd party components (some directives from Angular-Bootstrap), which is also ...
5
votes
2answers
2k views
Access $stateParams of new state in service called from resolve function with UI Router
Is there a way to access $stateParams for the state you're transitioning to from a service called in a resolve function? With ngRoute you'd use $route.current.params. As this minimal plunk shows, the ...
5
votes
1answer
6k views
AngularJs templates not loading in internet explorer 8
I am not able to render AngularJs templates in Internet Explorer 8, I have followed several suggestions for using AngularJs in Internet Explorer but I am still not able to get it to work. below is my ...
5
votes
1answer
111 views
UI Bootstrap checkbox and radio slow on ipad
Trying to implement Checkbox and Radio buttons from http://angular-ui.github.io/bootstrap/ but it is very slow (about a second) to react.
Is there something I can do to make it react more quickly? Or ...
5
votes
0answers
111 views
Bootstrap ui angularjs with filter issue
I am using Bootstrap UI in my angular application. I have a tooltip in the html page which works fine. I noticed that after the tooltip is displayed and I move my mouse out, the Ui-bootstrap-tpls.js ...
4
votes
1answer
1k views
Angular - no method sortable
I am including all necessary scripts (The error was in order of the scripts + missing jQuery):
<script src="scripts/vendor/angular/angular.js"></script>
<script ...
4
votes
4answers
5k views
Angular UI Router - Views in an Inherited State
edit: Based on the answer by @actor2019 I want to update my question to better explain the problem:
Using Angular UI-Router(v0.0.2), I've setup the app to properly navigate between main ...
4
votes
1answer
1k views
ng-model input inside an angular-ui modal controller is undefined
In my modal template I'm trying to use ng-model to assign a value to the scope of my controller ($scope.name), but it doesn't work. It gives me undefined. What am I doing wrong? Plunker here
I ...
4
votes
1answer
3k views
Angular ng-disabled with function
I want to use disabled-ng with dynamic value returned from a function.
I have tried several ways but it is not working.
<textarea id="{{exercise.type}}" ng-disabled={{prova}}></textarea>
...
4
votes
1answer
494 views
angular.js: using a directive to insert another directive as an attribute
For example, UI Bootstrap has a directive called 'typeahead' that suggests values for a field. Let's say I want to make a directive that I can use as an attribute for an element that will cause ...
4
votes
2answers
1k views
Change the folder location for Angular ui-bootstrap templates
I am trying to use ui-bootstrap.min.js with the external templates.
The error I am getting is:
http://localhost:13132/Place/template/timepicker/timepicker.html 404 (Not Found)
I would like for ...
4
votes
1answer
2k views
Angularjs bootstrap datepicker: Select multiple dates
I am trying to use the angular UI strap datepicker. How to select more than one date from the datepicker and return the value as an array.
http://mgcrea.github.io/angular-strap/#/datepicker
3
votes
4answers
7k views
Handle open/collapse events of Accordion in Angular
If I have this code:
<accordion-group heading="{{group.title}}" ng-repeat="group in groups">
{{group.content}}
</accordion-group>
Using AngularJS, angular-ui and Twitter ...
3
votes
2answers
4k views
AngularJS - “Error: Template must have exactly one root element” when using Angular-UI Typeahead
I'm using AngularUI Typeahead, on the 'index' page of my app. I'm not doing anything fancy - in fact, I'm just trying to get the example they've got up on their UI site working, and I'm getting this ...
3
votes
2answers
2k views
angular js : Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape?
Am using the angular bootstrap to present modal . But my requirement is to prevent pop-up dismissal when clicking outside the modal.
I followed the tutorial in angular bootstrap site ...
3
votes
2answers
2k views
AngularUI-Bootstrap's Typeahead Can't Read `length` Property of `undefined`
I am getting the following error when I attempt to get a typeahead values from AngularUI-Bootstrap, using a promise.
TypeError: Cannot read property 'length' of undefined
at ...
3
votes
1answer
5k views
Using $scope functions from a different controller in AngularJS [duplicate]
I'd like to share the $scope functions of one controller in another controller, in this case for an AngularUI dialog.
Specifically in the example below, I'd like $scope.scopeVar to be available in ...
3
votes
4answers
4k views
Angular-ui modal issue
I'm trying to include an angular-ui modal in my web application but am having issues with getting everything set up.
The documentation indicate that you can use $modalInstance to inject the child ...
3
votes
2answers
3k views
AngularJS ui-calendar – model with events
I’m trying to set up a calendar according to the instructions. The calendar itself shows up on the page, but it doesn’t display any events.
Code in template:
<div ui-calendar ...
3
votes
3answers
152 views
Deferring angular controllers until Ajax call is completed
First of all, I have googled and searched on SO for this question. None of the answers I've seen are really satisfactory for me. I am aware of resolve & manually bootstrapping angular and neither ...
3
votes
2answers
1k views
Angular UI-Router fails to load template that I didn't ask for
Plunker Code Showing Issue Described Below
http://plnkr.co/edit/Bz3Qhf1eDuFrnKI0qnUo?p=preview
I am using two components of the AngularUI suite, UI-Router and UI-Bootstrap.
UI-Router is responsible ...
3
votes
1answer
1k views
Angular UU TinyMCE : How set default settings
I am using angular ui tinymce extension. I would like to know how do i set the following setting which i can do in regular javascript.
tinymce.init({
selector: "textarea",
height: ...
3
votes
1answer
68 views
Angular UI Modal controller is not exposed to directives
I need to create a directive that can be used inside Angular UI modal. This directive also need to know about modal's controller in order to use some functions from it. What I have now:
JS:
'use ...
3
votes
1answer
470 views
angular ui-router: get state name in resolve
I would like to access the state's name and other attributes the app is navigating to using angular ui-router when working on the resolve.
The reason: I want load some user data (including their ...
3
votes
1answer
262 views
Angular-UI-Calendar Late Binding?
I am using Angular-UI's calendar which I really like. However, I am having an issue with late binding.
The directive is like this:
<div ui-calendar="uiConfig.calendar" ng-model="eventSources" ...
3
votes
2answers
225 views
AngularJS change URL but not view
We are using angularJS and angular ui-router and want to change the URL in the address bar but keep the view/state the same.
I have tried using history pushstate but I am having conflicts with it ...
3
votes
1answer
80 views
How to Dynamically add Direcitves angularjs
I have successfully Added an angularjs directive into another directive using this code
var newElement = $compile( "<div my-diretive='n'></div>" )( $scope );
$element.parent().append( ...
3
votes
1answer
54 views
Preselecting option with angular-ui-select2 0.0.5
I'm having trouble preselecting an option in an select2 select box using Angular and an ng-model. Here's my code:
Angular code in controller
$scope.filter = {
searchValue: '',
departmentId: ...
3
votes
1answer
272 views
AngularJS - Accept a ui.bootstrap modal with ENTER key
The Issue:
I've been unable to to accept a modal window with the ENTER key
I have modified the default Plunker to show you what I've done since now --> Here
What I have:
Briefly, the ENTER key is ...
3
votes
2answers
651 views
How to make angular ui-router's parent state always execute controller code when state changes?
Let's say we have a parent-child relationship defined in our $stateProvider as follows:
.state('myProfile', {
url: "/my/profile",
templateUrl: 'my/profile.html',
...
3
votes
2answers
917 views
Angular UI Router - nested routes, not work templates in nested state
Here is my code:
.state('profile',{
url : '/profile',
templateUrl: 'views/user.html',
controller: 'UserCtrl'
})
.state('profile.forgot',{
url : ...
3
votes
1answer
2k views
Angular UI Bootstrap Tabs open on route change
I am using the tab directive from Bootstrap UI for my current AngularJS project and am heavily struggling with the implementation of route-based tabs.
<tabset>
<tab heading="Dashboard"
...
3
votes
1answer
535 views
Angular.js - does form validation emit any events?
The problem is, I'm using ui-router and I have two views, one is kind of a toolbar, second is content with a form.
Now I'd like to have a save button in the toolbar, which would be disabled if form ...