Latest Angular.js Recipes

Get value in a row on click and pass it to popup

I need to get the value in a row of a table on click and display it in popup

HTML:

<md-data-table-container>
    <table md-data-table class="md-primary" md-progress="deferred">
        <thead md-order="query.order" md-trigger="onorderchange">
     ...

Read the entire recipe Recipe added 44 minutes ago

how to upload a file in Restangularjs using multipart/formdata

my html code

<form  method="post" enctype="multipart/form-data" ng-controller="commentCtrl" name="form">
        <a href="" type="file" class="custom-height"><img src="source/assets/images/icons/icofileattached.png" class="attachmentpng-height" ...

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

Create empty object or object with null values for already known keys

I am playing around with JavaScript and AngularJS since a few days and I am not sure about the following:

I am working on a sample project in which a user is able to create a new car with just a few properties stored in an JS object like this:

var...

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

How to retain the scroll position of ng-repeat in AngularJS when removing an item from the top

I tried to work from the solution to this

How to retain scroll position of ng-repeat in AngularJS?

to achieve retaining the scroll position when removing the top item in an ng-repeat but couldn't figure out the code to do so.

Also, side note, the...

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

How to navigate one page to another page using AngularJs

How to navigate from one page to another page. Assume i have a login page, after entering username and password fileds while click on submit button it needs to validate and if both username and password is correct it needs to go home page. Home page...

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

Status code 405 (Method Not Allowed)

I'm new to AngularJs and Ionic. Building a schedule app just to practice so please go easy on me.

I don't know why I'm getting this 405 response. I tried to do a GET request with postman with the same information and it worked, but it doesn't work...

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

Angular 2 - How to listen to event without a template?

The Problem

Normally, in Angular 2, one would listen to an event via the following syntax:

<my-elem (customEvent)="customEventProcessor"></my-elem>

But when I use a router, that host - <my-elem> - does not exist in any template. Instead, there's a...

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

how can a new row (record) be added to a ui-grid

I cannot find an answer to this in stackoverflow or an answer I can understand in github..the issue is simple..I want to be able to use ui-grid much as I would a datasheet or continuous forms in MS Access..I think I have editing sussed (at least on a...

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

AngularJs assign http response object to scope from html

This is the first time I use AngularJs and I would really appreciate some help on this.

I have a json file from which I am retrieving some content that gets displayed on my html template. So far so good.

I need to assign an http response data to the...

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

AngularJS: Background process

I have an angular app and I would like to add a background process that runs without any view. All it is doing is regularly call a webservice and do something about it, no UI.

A quick and dirty way is to simply put the code in window.onLoad. But...

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

In AngularJS how to uncheck a radio button to make all objects become false

I have an array with many "contact" objects inside. Only one contact can be the primary contact (primary: true).

I also have a radio button to select which contact is the primary.

Q: How can I make one contact primary and deactivate all of the...

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

angular js, broadcast an event and wait for it to complete

I have a an angular event like this:

$rootScope.$broadcast("postData");
doSomething();

however, doSomething() must wait for postData to complete before execution. I would normally do something...

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

How to refresh/reload kendo comboBox dataSource with AngularJs?

I do:

    .data('kendoComboBox').dataSource.read();
    .data('kendoComboBox').refresh();

but comboBox still doesn't reload.

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

Angular routing ui-view inside another ui-view

Conception overview:

We have two tabs on index html. There we routing those tabs like that:

<div ui-view></div>

On a second tab we have a selector, that switch tab's content in another ui-view like that:

<div...

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

angular validation - prevent button ng-click() when form is invalid

I have an angular form as part of a single page App. The 'Continue' button moves a user to the next section of the app, and has an ng-click. I would like to prevent this ng-click from happening when the button is clicked and the form is invalid, but I...

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

Angularjs: How to access main controller from modal controller and directive controller

I am new to Angularjs and working on a pet project. I have a main page which has functions in HomeController. Then I have a button in the main page which on click opens a modal and the modal has a separate controller called ModalController. There is...

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

Dynamic Content in Dynamic Tab (Angular, UI Bootstrap)

I'd like to use ng-include in the content of a dynamically generated tab using AngularJs and UI Bootstrap.

I have a Plunker here: http://plnkr.co/edit/2mpbovsu2eDrUdu8t7SM?p=preview

<div id="mainCntr" style="padding: 20px;">
  <uib-tabset>
   ...

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

Ionic - Multiple view in same page

I am kind of a noob in Ionic and I need help / guidelines to build something that sounds easy. I want to have a single page composed of multiple content, the idea is to have multiple views in the same page each of them being linked to a specific...

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

Using Angular and ng-repeat to add Attributes to an HTML DIV

we are using AngularJS and we are looking to create a series of HTML DIVs using ng-repeat with different HTML Attributes for each DIV.

For example we have the following list representing the DIVs we wish to create

{"id":"year","class":"zone...

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

Angular UI Router: How to go to the same state with different $stateParam?

I am wondering how can I go to the same state, with different $stateParam?

I was trying to go with:

$state.go('^.currentState({param: 0})')

However, it was not working.

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

Can I install Angular Material library without Bower or NPM?

I want to install the Angular Material library in a project, but I am behind a corporate firewall and even configuring the proxy doesn't work, it seems the proxy blocks certain types of files. Is there a way to install this offline?

FYI this is my...

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

AngularJS: Select with ng-options- how to pass value as integer?

I am having an issue with my select form. When I select any option, the value that is being passed is of a string type, instead of number type. Here is my object that I use for ng-repeat:

$scope.apples ={
         0:'Apple0',
         1:'Apple1',
   ...

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

how to pass the value from one page to another page in angular?

I am starter of angular, when i am passing the value that i am entering into textbox i am able to see text="value" on header in pageA[\adminlogin] but when i am routing from one page to another page i am not able to see the same text on...

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

Using md-select, pass the entire object of an ng-repeat item, not just a string

I have made a form with Angular Material that uses a dropdown list to choose from an array of book objects, with names and IDs, for the ultimate purpose of trading it for another book in my collection. Here is what my typical trade object looks...

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

AngularJS POST Fails: Response for preflight has invalid HTTP status code 404

I know there are a lot of questions like this, but none I've seen have fixed my issue. I've used at least 3 microframeworks already. All of them fail at doing a simple POST, which should return the data back:

The angularJS client:

var app =...

Read the entire recipe Recipe added 1 day ago