Skip to main content

Questions tagged [angular.js]

Code written using version 1 of the AngularJS open-source JavaScript framework. Use 'angular-2+' for code using later versions.

Filter by
Sorted by
Tagged with
1 vote
1 answer
77 views

Selecting/ Deselecting All from Checkbox

...
Nɪsʜᴀɴᴛʜ ॐ's user avatar
2 votes
0 answers
30 views

Actions component in Angular

I have an action bar component. It helps do the CRUD operation for different component. Its only job is emit events. The emitted events are listened by the caller component. I am using a switch case ...
mozpider's user avatar
  • 121
2 votes
1 answer
500 views

Is returning promise form angular service bad?

What is the problem when I return a promise from angular service instead of Observable? If it's a matter of any manipulation or side-effect, that I can easily do ...
Siraj M's user avatar
  • 115
4 votes
2 answers
409 views

Blogging application with Codeigniter back-end and AngularJS front-end

I am working on a blog application with Codeigniter 3.1.8 and AngularJS v1.7.8. The Dashboard of the application is "pure" Codeigniter, with Models, Controllers, and views, while the fronted is made ...
Razvan Zamfir's user avatar
2 votes
1 answer
77 views

CSV-simplified: A small open source project

I'm working on a small open source project called CSV-simplified for a course I'm taking (Bloc), and I'm looking for some feedback and potential collaborators. I don't actually know an programmers, so ...
conkytom's user avatar
2 votes
0 answers
207 views

Addition of defaults to components in AngularJS

I wrote a small module in typescript that augments the angularjs registerComponent function to provide a new way of default values for the component controller. ...
K. Ramharak's user avatar
3 votes
1 answer
84 views

Create objects corresponding to whichever field has value from among a list of fields

I have to create a form, which enables users to move stock of items to different statuses. The form will show the current stock(quantity) in a given status and then 5 input fields corresponding to 5 ...
stonemusic's user avatar
2 votes
1 answer
563 views

Paginated AngularJS posts application

I have made a small application that displays a posts JSON in the form of cards, with the help of AngularJS and Twitter Bootstrap 4. The application has an interface for pagination and there are ...
Razvan Zamfir's user avatar
2 votes
1 answer
87 views

show/hide components

The following code is used to show/hide components in an AngularJS app: ...
knot22's user avatar
  • 469
2 votes
1 answer
84 views

Comparing JSON documents for changes to values

Please go through below code and improve the quality by reducing the IF conditions: I have 2 jsons, first one is the source and second one is the updated json. I have to compare both values and set ...
asder's user avatar
  • 23
2 votes
1 answer
4k views

Script to load controllers dynamically for AngularJS

I would like to hear your thoughts, idea's or feedback on the following code. Ive added to code to github. https://github.com/redbullzuiper/angularjs-dynamic-controllers Usually when you attach a ...
Red's user avatar
  • 227
2 votes
1 answer
124 views

A simple AngularJS application for counting the number of gallons of paint

I created a simple Angular JS application for calculation gallons of paint needed to paint the ceiling of a room. I assume one gallon covers 350 square feet and use it as a constant. Also, I round up ...
Kate Herasimenak's user avatar
0 votes
1 answer
65 views

Deep custom AngularJS Filter

I need to filter projects using a searchbar, it should filter all properties of the projects with a few exceptions. It's working, but it's extremely slow, where can I make optimizations? The "_" is ...
Cold_Class's user avatar
2 votes
1 answer
329 views

Laravel Single Page Application Using Angular Js

I have created a Laravel Single Page Application using Angular Js 1.3.14 by learning tutorials in the websites. index.php: ...
Kannan K's user avatar
  • 123
2 votes
3 answers
92 views

Collecting a list of documents from a factory for an AngularJS controller

With this controller I'm injecting myFactory and using Array.push() to add the array ...
Wayne's user avatar
  • 45
0 votes
1 answer
8k views

Move an element up / down an array in Javascript

I have an array called list bound to the current application scope $scope that is a user order-able list of UI components. When ...
Luke's user avatar
  • 349
1 vote
1 answer
83 views

Chaining three promises in Angular.JS

I have demonstrated promise chaining where promise's p1,p2,p3 has to be resolved synchronously. The code below is using angular.js 1, and here P3 is resolved then P2 and then P1. ...
Rahul Shivsharan's user avatar
2 votes
1 answer
130 views

AngularJS - Making Factory and Controllers DRY

The following code works, but: The service makes multiple API calls, the functions are very similar with a lot of code duplication. The same is true for the controllers- very similar code with only ...
Wayne's user avatar
  • 45
2 votes
0 answers
1k views

AngularJS Null coalescing operator filter

I am relatively new to AngularJS and am coming from a PHP background. One of the new features for PHP7 was the Null coalescing operator. In short, it checks if a value is set and if it is then it ...
BritishWerewolf's user avatar
3 votes
2 answers
758 views

Traverse and modify a deep object

I wrote this piece of code yesterday at work. This function will traverse a deep nested object to find and modify a value. I know it's bad, so I am trying to refactor it. I have not found any ...
kkkkkkk's user avatar
  • 161
2 votes
0 answers
247 views

AngularJS application for working with the Facebook API (using the cordova-plugin-facebook4 plugin)

I'm creating an application with AngularJS, and packaging it up with the Phonegap build. I'm using the facebook API (phonegap cordova-plugin-facebook4) for user authentication and getting a user's ...
Sarah's user avatar
  • 401
4 votes
2 answers
93 views

Grab the first 4 items that meet the condition from a data set with an unknown size

I was turned down for a job after a coding take-home test, and some of the feedback I received was: would have preferred to see more functional programming instead of while loops - and the while ...
Neil S's user avatar
  • 141
0 votes
1 answer
48 views

Managing JS objects while preserving references

Scenario I have foo: { name: 'Mr. Foo', value: 4 } I receive bar from the server:...
maxathousand's user avatar
4 votes
1 answer
160 views

Simple angular app - Shopping website

In looking for a bit of feedback about an Angular app I have created. I'm new to angular I want to clean up the loose ends before I carry on and add new functionality. Below is the code snippet of ...
Kevin's user avatar
  • 41
3 votes
2 answers
590 views

Splice from Array if index matches

This code loops through an array called $rootScope.watchlist (uses AngularJS). It gets the current iteration of the loop to access that x iteration through ...
user148450's user avatar
0 votes
1 answer
2k views

File upload in AngularJS causes browser out of memory error

I have an AngularJS code to perform upload of files. At first I thought it works OK but when I've tried to upload bigger files (e.g. 5 files, 10 MB each) then I saw that this code has very poor ...
Mariusz Ignatowicz's user avatar
3 votes
1 answer
627 views

Returning the results of four $resource calls as a JSON array in AngularJS

Title pretty much says it. I need a way to elegantly handle multiple $resource calls in AngularJS. Right now, I just calling each other call on the ...
Jimenemex's user avatar
  • 185
1 vote
2 answers
89 views

Unit tests for a single JavaScript function

Here is the question: What is the better way to unit test this specific function? Should all the test items be included in one test or is it better to break up the tests so each test is testing for ...
nweg's user avatar
  • 113
1 vote
1 answer
142 views

Tying the enablement of one checkbox to another using AngularJS and jQuery

I'm new to AngularJS, coming from a jQuery background and I have a situation I've solved but only by including jQuery in an AngularJS function. Something just doesn't feel right doing this and I was ...
BMills's user avatar
  • 231
2 votes
0 answers
80 views

Angular 1 CSS Encapsulation

I am trying to get a good clean way to do CSS Encapsulation in Angular JS. The main goal of this is to use isolated components. This is what I have come up with so far. The method I am using is ...
Michael Warner's user avatar
4 votes
1 answer
2k views

Step by step wizard

I'm currently working on creating a step by step wizard in Angular and twitter-bootstrap. I've actually got it to work as intended but as I'm looking to advance my skills I'd like to hear if you have ...
InfinityStream's user avatar
2 votes
0 answers
177 views

breacrumb directive for angular-ui-router

This is a simple directive that creates breadcrumbs on the fly for Angular.js pages using angular-ui-router ...
Sibiraj's user avatar
  • 121
3 votes
3 answers
320 views

Use counter for ajax loader

I was using a Boolean var for indication of loading so my code looked like this: (this example is in angularjs but i think it can be relevant for any ajax call handlers) ...
Ziv Weissman's user avatar
4 votes
1 answer
91 views

Getting hex colours from a image

I am trying to get the hex colours from an image. The problem I am having is that for some reason randomly the code causes high CPU usage, which times out the browser and I am not sure how to optimise ...
Limpep's user avatar
  • 141
0 votes
1 answer
475 views

Generating a list of menus with AngularJS

Some days ago, I decided to start learning a JS framework in order to gain skills and become more useful at work. I choose Angular for the purpose, and started learning it by building up my "...
Zolt?n Schmidt's user avatar
5 votes
1 answer
257 views

Particle text directive

Directive that shows text as particles on a canvas. Looking for a general review. Plunker here. image.service.js: ...
MAG's user avatar
  • 2,974
5 votes
1 answer
1k views

Using chartJS in Angularjs to plot IOT data

I am a Javascript and AngularJS beginner. Below is the code inside my chartController. What this does is get IOT data from a back-end call and display it in my front-end with a chart. There are two ...
DewiJones's user avatar
0 votes
1 answer
397 views

Communication to Child Controller

This is a simple AngularJs application with two nested controllers. We need to pass data from the parent to the child Controller. The first thing you find when googling for a solution would be this, ...
LocalHorst's user avatar
4 votes
1 answer
1k views

Displaying a table using DataTables and AngularJS

I am using DataTables to format and display a table. I started the project using AngularJS with a PHP backend but I needed to inject some Vanilla JS and JQuery code in order to use DataTables. Is ...
Joseph's user avatar
  • 263
0 votes
1 answer
452 views

Car dealership landing page

Please give feedback on what I could do better next time. This is an Angular 1.x landing page I made for a pretend car dealership. Here is what it looks like. Here is the app.js: ...
Dream_Cap's user avatar
  • 641
4 votes
1 answer
160 views

Handling two datepickers in a form with angularjs

Here's I am using simple form with angularjs. Everything works fine. I am having watchgroup for EndDateFrom & EndDateTo datepickers. When it's defined I am logging the value to console. I am ...
Vijay's user avatar
  • 41
6 votes
2 answers
36k views

JavaScript filter() on JSON object?

I'm building a web interface for a home monitoring sensor array, and fetching JSON from the backend framework. I want to start putting statistics together for monitoring different areas of the home, ...
Jon Mitten's user avatar
2 votes
1 answer
4k views

Performance problem with Angular and rendering a grid

I have a big problem with performance with a web application using AngularJS. I currently have a grid that renders an array of objects. It looks something like this. ...
Heathcliff's user avatar
3 votes
0 answers
430 views

Publishing angular-cli component library to npm or like

I've found a lot of blog posts that seem to suggest publishing a library TypeScript (as source) and all to npm or to a private repository. It feels like we should be doing some transpiling first and ...
Arran Bartish's user avatar
3 votes
0 answers
6k views

Angular UI Datepicker Popup with Default Time

I need to set date and time (12 hours 0 minutes) via Angular UI DatePicker Popup. plunker I had two issues: 1. When page was loaded: Input had value 17-March-2017 12:00:00.000. It's right. But ...
user5367575's user avatar
1 vote
1 answer
68 views

How to refactor / re-architect the components/state here in ui-router app [closed]

https://plnkr.co/edit/bOZW1a9u62W1QA6cYjYj?p=preview My goal has been to separate the Dashboard states from the Feed state. ...
Leon Gaban's user avatar
3 votes
0 answers
297 views

AngularJs: Preventing multiple $q.get() per url

I've wrote a pretty useful method to prevent multiple requests per single get url. There is a well known pattern - to store promise and return it for each next ...
Kindzoku's user avatar
  • 218
4 votes
1 answer
2k views

Handling combinations of optional parameters for an Angular filter pipe

This is a simple implementation of an ng2 filter pipe, which can currently take 2 optional facets: <string>status and ...
msanford's user avatar
  • 391
1 vote
1 answer
471 views

ToDo App in AngularJS

I have written a todo list app. I want to understand how to improve it. Here's what I'm trying to understand: My problem is when user clicks on task to edit, because it passed by reference, so if ...
Lior Cris's user avatar
1 vote
1 answer
46 views

Taking objects from literal with many objects

I have data returned from an API coming back in a response: response.data ...
user avatar

1
2 3 4 5
8