Latest Angular.js Recipes

AngularJS not showing my ng-view

I'm trying to do a simple angular app with rails. For some reason my <div ng-view></div> html tag shows as <!-- ngView: --> when I view the inspector. I'm not getting any errors in the console. I'm new to Angularjs and I can't figure out why this is...

Read the entire recipe Recipe added 55 minutes ago

AngularJS : get back data from a json array with an id

I have a json file where i am stocking informations from all the people in my database. I actually use it to display first name, last name in a web page and i want to add the possibility to display the details of every person.

To do so i'm using the...

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

angularjs ng-model select not updating properly

I've got a very simple form with a select that contains all the states + abbreviations. When using the keyboard to navigate the second keypress doesn't change ng-model value in certain circumstances. For example if you tab to the select element and...

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

Angular JS: get ng-model on ng-change

I have the following HTML

<select ng-model="country" ng-options=" for c in countries" ng-change="filterByCountry"></select>

That is beeing fed by the following object with a list of countries

$scope.countries = [{name:Afeganistão,...

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

Angular JS filter not equals

Seems like a very basic question but I can't get the syntax right..

<li class="list-group-item" ng-repeat="question in newSection.Questions | filter:Id != '-1'; " ng-mouseenter="hover = true" ng-mouseleave="hover = false">
    <div href="#"...

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

angularjs | date input not showing ng-model value

date input is not showing the date until the user change it

// showing the date
<p>{{someDate | date}}</p>

// not showing the date. instead showing mm/dd/yyyy.  
// but value will change when use change is
<input type="date" ng-model="someDate">


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

How to use jQuery in AngularJS

I am trying to use simple jQuery UI. I've included everything and I have this simple script:

  $(function() {
    $( "#slider" ).slider();


<div id="slider"></div>

My includes:

<script type="text/javascript"...

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

Angular JS directive, change a 2 way data binding in the link function

I'm trying to create an angular directive where I can set the options either via a single options object, or via some attributes. Here is an example of the kind of code:

app.directive('testElement', [function () {
    return {

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

How to use asynchronous calls in a loop in angular?

Each email in a list is to be sent to server and response to be be got from server that if it is a valid email.

So after all emails are checked the array should have : - valid - invalid -...

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

Angular-animate - Unknown provider: $$asyncCallbackProvider &lt;- $$asyncCallback &lt;- $animate &lt;- $compile

I have a strange issue. I want to include angular-animate in my AngularJS project - I am using AngularJS v1.2.6. I have added angular-animate to my bower file. It has downloaded and added to my HTML file in the source and it is pointing to the correct...

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

AngularJS UI Bootstrap Datepicker Date Format in Controller is not correct

I am using a datepicker in my html page as follows:


  <div ng-controller="StartDateCtrl">
    <label class="control-label" for="startDate">  Date:</label>   
    <div class="row">
        <div class="col-md-6">

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

Modifying DOM (slideDown/slideUp) with AngularJS and jQuery

I'm trying to implement a slideDown/slideUp animation with AngularJS. I can't use CSS3's transition (unfortunately) since the height is set to auto (and I don't want to use the max-height workaround), so I'm trying to use jQuery's slideToggle...

Read the entire recipe Recipe added 12 hours ago

Rendering unicode-utf-8 turkish characters with angular-js

Characters from a binded JSON text, Turkish the letters are shown with wrong encoding for eg. &Ouml;zlem G&uuml;zelharcan which shall look like "özlem güzelharcan". I added <meta characters="utf-8"> in the head still no solution and there was no...

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

put html DIV into a popover content angular UI

Is it possible to put html content into a popover? this is the string that i need to put into the popover


$"sentence " +
    "<li>first list member</li>"+
        "<li>element of the first list</li>"+

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

Changing body background color with angularjs

I want to be able to change the background color of <body> depending on what the current path is.

I tried doing it by checking $location.path() whenever the path was changed and then using the ng-style directive to change the background color but...

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

angularjs bootstrap collapse horizontaly

How can I make angular bootstrap collapse, collapsing horizontally? Something like here?

Read the entire recipe Recipe added 16 hours ago

Angular JS AJAX Call with Parameters

without the parameters of the method Get, the code works, but if the method asks for a parameter an error 404 is returned. How do I properly send parameters with Angular JS?

factory.test = function () {
    var q = $q.defer();


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

AngularJS submitting handling a form with multiple inner controllers

Good day pals, I have just started with AngularJS and have been having nightmares!

I have the following partial html form included within a parent html using ng-view.

 <form name="FormName" ng-submit="addToBasket()"...

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

Angular JS Two-Way Binding with Dropdown in Grid

I am using AngularJS as well as Parse and the Parse-Angular-Patch. I have a sample app that does basic crud. My CRUD app

When I click the edit button. The Salutation loses it's state. My bug

Here's the relevant HTML:

        <tbody data-ng-repeat-start="p in...

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

Angularjs $http.get not working

on my server side ( MVC) I have method which looks like this:

    public JsonResult GetTrenings(string treningId)
        var tempId = Guid.Parse(treningId);
        var trening = TreningService.GetTreningById(tempId);

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

AngularJS - Highlight specific table rows when using ngRepeat

Sample Table

<table class="table table-condensed table-striped table-responsive">

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

angularjs corousel stops working

Im trying to make a carousel with ui-bootstrap for angularjs, i basically copied/pasted directly from the angular docs, and it works BUT it stops working at the last slide.

It does not come back to the beggining, and the controls stop working, im not...

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

How to obtain index in nested ng-repeats

I have an ng-repeat within a ng-repeat. I am tyring to obtain the index at both levels but am not able to :

    <tr ng-repeat="element in body">
      <td ng-repeat="h in header" style="width:{{h.width}}px">

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

&#39;Cannot find module&#39; error using karma-browserify on Windows

I'm attempting to set up unit testing on an Angular/Browserify project using Karma, Karma-Jasmine, and Karma-Browserify. I'm on a Windows machine, for reference. karma-cli is on my global npm path, and karma, karma-jasmine, karma-browserify, and...

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

Angular.js caching $compiled templates / rendering performance of directives inside ng-repeat

I have a a directive which renders table cell(see how the way I'm compiling it here, basically using $compile inside link fn Angular.js directive template using variable from parent/inherited scope), now this is used inside two ng-repeats, one for...

Read the entire recipe Recipe added 1 day, 1 hour ago