Latest Angular.js Recipes

Two-way bind does not work if the model is something like ng-model="" for Kendo UI controls

I have a problem with Kendo UI controls


 <input type="text" ng-model="" kendo-numeric-text-box />
 <input type="text" ng-model=""> </input>
 <button ng-click="resetRecord()" >test bind</button>


Read the entire recipe Recipe added 19 minutes ago

What do I need to include that angular bootstrap just simply works

I have included these in my index.html because bower is including them:

<link rel="stylesheet" href="//">

<!-- bower:js -->

Read the entire recipe Recipe added 1 hour, 18 minutes ago

multiple ui-view html files in ui-router

Is it possible to make something using 2 or more html files using ui-view? I need it to be something like this : enter image description here

I've tryed to do something working on plinker, but looks like I clearly don't uderstand concepts. I've read a nested ui-vew tutorial but...

Read the entire recipe Recipe added 2 hours, 23 minutes ago

AngularJS $ error in Internet Explorer &lt;= 9

I have the following bit of code, which works fine in every modern browser, but fails in Internet Explorer 9 and below.

authService.login = function(credentials) {
  return $'', credentials).then(function(res) {

Read the entire recipe Recipe added 3 hours, 22 minutes ago

multiple `.then()`s on single angularjs promise -- all use _original_ data

I'm writing an angularjs app relying on promises, and though it's working, I wonder if I could do it more optimally.

At the beginning of the code, I'm creating a promise that goes off to fetch some data. When this is done, I want to run several...

Read the entire recipe Recipe added 4 hours, 24 minutes ago

Angular JS $http.get does not receive data from PHP script

I am using angular's $http.get function to call a PHP script file to retrieve data

var $promise = $http.get("../php-bin/example.php",obj).success(function(data) {


The php is supposed to just get...

Read the entire recipe Recipe added 5 hours, 19 minutes ago

How to set value in input field in angular js?

I am a beginner in angular. I am able to make drop down and able to get it value using ng-model. But I need to get different value on input field. If the value of drop down value is blank then input field value is "blank". When drop down value is...

Read the entire recipe Recipe added 6 hours, 23 minutes ago

Angular ng-model: empty strings should be null

If I use ng-model for an input field and empty it, angular sets it to '' instead of null even if it was null before.

This is a problem in my case because I need to send null to the server if the input field is empty, and not ''.

Is there a way to...

Read the entire recipe Recipe added 7 hours, 20 minutes ago

Can ng-disabled disable group of child elements?

I am trying to disable a group of element using ng-disabled in its parent element. Doesn't seem to work. Does it mean I have to using same condition in all child element to disable ?

I am not able to disable all elements by putting ng-disabled="true"...

Read the entire recipe Recipe added 8 hours, 16 minutes ago

Undefined function: .succes in $ (angular.js)

I've been trying to make a search with Angular JS but I get this weird error: TypeError: undefined is not a function and it is on the .success

Here is my code:

<html ng-app="app">
<meta charset="utf-8">

Read the entire recipe Recipe added 9 hours, 23 minutes ago

How do I add a reusable modal dialog in Angular?

I'm new to Angular and attempting to implement this solution into my project.

It looks painfully easy, however, I'm trying to make this into a re-usable element so that I can call it from anywhere and just pass in the content to be shown (otherwise,...

Read the entire recipe Recipe added 10 hours, 24 minutes ago

Get length of an array returned by firebase

The usual .length property of the array doesn't work on the arrays returned by firebase. Here is the console.log of the returned array:

0: Object
1: Object
2: Object
3: Object
4: Object
$$added: function () { [native code] }
$$error: function () {...

Read the entire recipe Recipe added 11 hours, 21 minutes ago

conditionally add ng-checked attribute in angular js

I want to add to the following:

<input  type="radio" ng-name='{{}}' ng-model='$parent.$parent.choice.input'  ng-value='{{option}}' id='{{}}-{{}}' ng-required='required'>

An attribute: ng-checked='checklast'

only if some...

Read the entire recipe Recipe added 12 hours, 18 minutes ago

Angularjs ui.bootstrap Accordion

I found this accordion effect which works very nicely:

But I need the accordion to open differently, so that the content of each accordion-group appears above the accordion-header that opens it. Just wondering...

Read the entire recipe Recipe added 13 hours, 20 minutes ago

spyOn $scope.$on after $broadcast toHaveBeenCalled fails

I'm having a lot of trouble getting this simple test working.

I've got an $scope.$on listener in a controller that I want to test. I just want to make certain it's called after a broadcast event.

To do this, I thought the following code would...

Read the entire recipe Recipe added 14 hours, 22 minutes ago

stateprovider in angularjs - not rendering the ui-view

Alright. I am stuck with this part for two days. I have tried everything i know. I have my ui-router loaded and stateprovider defined. I have the UI as shown in several examples in website. But when i run, it is not showing my ui-view....

Read the entire recipe Recipe added 15 hours, 17 minutes ago

Angularjs page initial load very slow

I'm pretty new to Angular and my page's initial load is extremely slow. After the initial load the navigation panel, which controls which products to include in the 'ng-repeat' runs perfect.

When I remove the script that begins my Angular JavaScript...

Read the entire recipe Recipe added 16 hours, 17 minutes ago

AngularJS - How to get serverside and clientside routing to work together

Im working on porting a project over to an angular based SPA. Its currently a more "traditional" node/locomotivejs app that serves up templates from the server side (never known the proper term for this).

The projects too large to to migrate all at...

Read the entire recipe Recipe added 17 hours, 24 minutes ago

UI-Router: sequential resolve of parent and child states

I have two abstract states parent and parent.child, and an activateable state parent.child.grand.

I want parent to be promise resolved before parent.child.grand gets its resolves executed. Why? Because a certain data which comes from the ajax request...

Read the entire recipe Recipe added 18 hours, 22 minutes ago

Angular UI Bootstrap modal inside ngRepeat

I am making an app, where I have a lot of input fields. Those input fields are generated from JSON object array field with AngularJS ngRepeat directive and have a button next to them which open an Angular UI Bootstrap modal to edit this value in a...

Read the entire recipe Recipe added 19 hours, 17 minutes ago

Angularjs route with hidden parameters like a http post

Can I get hidden parameters like a http post with $location?

Concept of what I'm thinking:

$location.param(key, value);

Read the entire recipe Recipe added 20 hours, 20 minutes ago

Angularjs Multiple directives [gridsection, gridsection] asking for template on: &lt;div gridsection=&quot;&quot;&gt;

I'm receiving the error: Multiple directives [gridsection, gridsection] asking for templateon : <div gridsection=""> with this code.

I don't see how i'm using nested directives or what is causing this.

html page

<div gridsection...

Read the entire recipe Recipe added 21 hours, 21 minutes ago

AngularJS: Factory is always undefined when injected in controller

I am trying a simple example of an AddressBook Angular application. I have a factory that returns an array of records and it it gets displayed in a list view using a List controller

angular.module('abModule', ['ngRoute'])

Read the entire recipe Recipe added 22 hours, 23 minutes ago

angularjs : @mention in textarea

I want to display an autocomplete form triggered by the word @ in my textarea like this library but only using angularjs & css

What kind of directive should I write ? Also, is there a way to implement this with the...

Read the entire recipe Recipe added 23 hours, 17 minutes ago

Send data to controller on angular

i'm trying to select a value from dropdown list and get the data from corresponded select id in angularJs

i have came up with angular-ui/ui-select directives

<ui-select ng-model="customer" theme="selectize">

Read the entire recipe Recipe added 1 day ago