Latest Angular.js Recipes

How to scroll with ionic and have fixed content above

I have the following view:

 <ion-view ng-controller="recentDetailCtrl as vm">
   <ion-content  class="has-header">
      <div  style="padding:0px;">
        <my-video  video-url='vm.videoUrl'

Read the entire recipe Recipe added 19 minutes ago

Angular UI router $transitions.onBefore

I am using angular ui router version 1.0.0-alpha.4 and since by default root scope events are inactive I thought of using new way of implementing auth mechanism as follows.

.run(['$transitions', '$timeout', '$q', '$state', 'AuthService',...

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

How to use ng-mouseover for hide and show input element on mouse hover

Here is my code:-

<div class="input-group">
    <input class="form-control" ng-model="name" required />
    <span class="input-group-btn">
        <button class="btn btn-primary" type="button" >
               <i class="fa fa-plus"></i>

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

Display pdf inside an ionic app

Im developing an app with ionic framework and I need to display a pdf.

I've read a lot on the internet and found this directive to use

The problem is that I'm having problems to integrate the...

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

Show Image Element only if image exists in Angular

I have two sibling elements. One is image and other is a div. I want to show image element if image exists and show div element if image doesn't exist. My elements looks like

 <img ng-show="product.img" ng-src="{{product.img}}" />
 <div class="left...

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

How can I retrieve the previous URL in AngularJS

I know I can get the current URL using $ and $location.path() but I need a way to get previous one. Can I use a global variable or something like that?

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

How to Download binary file in angular js using http

I want to downlaod exe file using $http, it shows me when I console the data, but I am unable to download it.

        url: url,
        method: "GET",
        headers: {
           'Content-type': 'application/json'

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

How to make md Content scrollable in Angular material Design

I am using ui-view in md-content to display a list but its getting overflow i want list in md-content should be scrollable here is my index.html

<div layout-lt-lg="row" class="screen-bg">
    <div flex-lt-lg="100">


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

ASP.NET Webforms and AngularJS

I'm still struggling to get my first ASP.NET WebApi / AngularJS app up and running...

I'm trying to query a WebAPI service (which I've written and verified using Fiddler that it works just fine) from Angular, and I'm trying to show the data returned...

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

Fetch and insert data into mysql using angularjs

I am unable to connect insert the date into sql server using angularjs & php.

I want to know how to insert data in sql and fetch the data from db.

    <div ng-app="myapp" ng-controller="empcontroller">
            Employe No....

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

How to pass JsonWebToken x-access-token through angular js

I created a node express RESTful API with jsonwebtoken as authentication method. But unable to pass the x-access-token as headers using angular js.

my JWT token authentication script is,'/authenticate', function(req, res) {

    // find...

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

Angular 1.5 Component: passing a function

Is it possible to passing a function to a component and call this function inside the component passing a parameter?


List of posts

<post-list posts="blog.posts"

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

Click() function isn&#39;t working in protractor scripts

I'm trying to automate my tests with Protractor and Appium for an AngularJS site with jasmine framework in iPad simulator, sendkeys() function is working for username and password, but when i click into the login button the test is passed, but the...

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

angular.min.js XMLHttpRequest cannot load file


/* app.js */

var model = angular.module('app',['ui.router']);

model.config(function($stateProvider, $urlRouterProvider){


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

Dismiss $uibModal from within

I'm using Bootstrap's $uibModal to make forms in my web-application. Everything works fine, except that I cannot close the dialog after it's been shown.

I spent two days trying not to post here such a simple question, especially when there was a lot...

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

Creating key,value pair dynamically with angularjs and passing the same to java Map

I have two empty text boxes in front end one for key and another for value one add button and a submit button.User can click on the add button to add one more pair of two text boxes each representing key and value respectively.

User is free to add...

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

ng-if date comparison using the == operator

ng-if="{{(Date | date:"dd/mm/yyyy") == (question.DateTimeEnd | date:"dd/mm/yyyy")}}"

I have this expression where $scope.Date = new Date().

I get a parser error . i am wondering if this can be achieved using the == operator in the mustache...

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

AngularJS : copy vs extend

Explanation :

we come across some situation in which we need to copy one object to another object. In that case, we probably have two solutions: angular.copy() or angular.extend().

Challenge i am facing :

As we know angular.copy(source,...

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

How to list all file name from a folder using angular js

Is there any function to list all file names from a folder using angular js. Since I'm having plenty if .js file to include. So is there any function for the same?

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

closing ngDialog in controller

i have two function , one for opening dialog and one for posting data to server and then close the dialog , the problem is i cant close dialog , here us the code

 vm.openCreateDialog = function () {

                 var Dialog ={

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

Array.from on the Internet Explorer

I have a problem with my angular app on the Internet Explorer. It runs everywhere without a problem (Chrome, Mozilla, Edge), but on on the IE.

I have analyzed with the Developer Explorer where the error is and it returned that the error occurs on the...

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

maxlength not working with input type=&quot;number&quot; ionic

I try to define maxlength of a number input.

 <label class="item item-input">
 <i class="icon ion-android-call placeholder-icon"></i>
 <input type="number"  placeholder="Phone number " maxlength="8">

How can i reesolve it...

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

RxJS Subjects and Angular2 components

I am coming to terms with the fact that web development is changing and I need to get to grips with RxJS. I am currently developing a web app using Angular 2.0.0-beta.15.

I am following the most excellent ng-book 2 (is that kind of advertising...

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

Multiple directives [ngController, ...] asking for new/isolated scope

I have the following (

<div parent parent-model="vm.model1" ng-controller="Controller as vm">

And the controller is:

app.controller("Controller", Controller);

function Controller() {
  var vm =...

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

How to include external js libaries in AngularJs 2?

I am trying to include an external js library in my AngularJs 2 app and trying to make all the methods in that js file as a service in Angularjs 2 app.

For eg: lets say my js file contains.

var hello = {
   helloworld : function(){

Read the entire recipe Recipe added 1 day ago