Tag: angular

56 votes
21 answers
495 views
AngularJS : How to watch service variables?

I have a service, say: factory('aService', ['$rootScope', '$resource', function

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
60 votes
12 answers
2.8K views
What is the difference between ng-if and ng-show/ng-hide

I'm trying to understand the difference between ng-if and ng-show/ng-hide, but they look the same to me.

avatar
Yolando
0 1 0 9
asked 07 September, 2021
57 votes
27 answers
1.5K views
Way to ng-repeat defined number of times instead of repeating over array?

Is there a way to ng-repeat a defined number of times instead of always having to iterate over an array? For

avatar
Keila
0 1 0 9
asked 07 September, 2021
58 votes
5 answers
2.6K views
AngularJS ng-click stopPropagation

I have a click Event on a table row and in this row there is also a delete Button with a click Event. When i c

avatar
Chaya
0 1 0 9
asked 07 September, 2021
58 votes
8 answers
2.6K views
How to display length of filtered ng-repeat data

I have a data array which contains many objects (JSON format). The following can be assumed as the contents o

avatar
Denese
0 1 0 9
asked 07 September, 2021
54 votes
18 answers
1K views
AngularJS 1.2 $injector:modulerr

When using angular 1.2 instead of 1.07 the following piece of code is not valid anymore, why? 'use stric

avatar
Virgil
0 1 0 9
asked 07 September, 2021
60 votes
8 answers
904 views
Working with select using AngularJS's ng-options

I have read about it in other posts, but I couldn't figure it out. I have an array, $scope.items = [

avatar
Corrin
0 1 0 9
asked 07 September, 2021
59 votes
11 answers
791 views
Watch multiple $scope attributes

Is there a way to subscribe to events on multiple objects using $watch E.g. $scope.$watch('item1, item2

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
60 votes
19 answers
2.5K views
What's the correct way to communicate between controllers in AngularJS?

What's the correct way to communicate between controllers? I'm currently using a horrible fudge inv

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
1.8K views
Angular ng-repeat Error "Duplicates in a repeater are not allowed."

I am defining a custom filter like so: <div class="idea item" ng-repeat="item in items" isoatom>

avatar
Rudy
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
1.5K views
AngularJS : Initialize service with asynchronous data

I have an AngularJS service that I want to initialize with some asynchronous data. Something like this: myMod

avatar
Omar
0 1 0 9
asked 07 September, 2021
51 votes
12 answers
455 views
ng-repeat :filter by single field

I have an array of products that I'm repeating over using ng-repeat and am using <div ng-repeat="pro

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
66 votes
11 answers
2.1K views
Redirecting to a certain route based on condition

I'm writing a small AngularJS app that has a login view and a main view, configured like so: $routeProvi

avatar
Solomon
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.7K views
Complex nesting of partials and templates

My question involves how to go about dealing with complex nesting of templates (also called partials) in an An

avatar
Arline
0 1 0 9
asked 07 September, 2021
60 votes
11 answers
1.8K views
AngularJS ngClass conditional

Is there any way to make an expression for something like ng-class to be a conditional? For example, I have t

avatar
Keith
0 1 0 9
asked 07 September, 2021
52 votes
7 answers
2.2K views
When to favor ng-if vs. ng-show/ng-hide?

I understand that ng-show and ng-hide affect the class set on an element and that ng-if controls whether an el

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
64 votes
10 answers
3K views
What is the difference between Polymer elements and AngularJS directives?

On the Polymer Getting Started page, we see an example of Polymer in action: <html> <head>

avatar
Roger
0 1 0 9
asked 07 September, 2021
67 votes
6 answers
3K views
Link vs compile vs controller

When you create a directive, you can put code into the compiler, the link function or the controller. In the

avatar
Elicia
0 1 0 9
asked 07 September, 2021
57 votes
24 answers
3K views
Combating AngularJS executing controller twice

I understand AngularJS runs through some code twice, sometimes even more, like $watch events, constantly check

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
62 votes
8 answers
1.4K views
What&apos;s the difference between ng-model and ng-bind

I'm currently learning AngularJS and am having difficulty understanding the difference between ng-bind an

avatar
Jeff
0 1 0 9
asked 07 September, 2021