What is the meaning of the singular/plural syntax in, say, ng-repeat="product in store.products"?
Confused by AngularJS ng-repeat syntax
2.9k views Asked by dpren At
3
There are 3 answers
0
Jon7
On
This is essentially the same syntax as a Javascript for...in loop. It means for someTempVar in someArrayOrObject.
Related Questions in ANGULARJS
- Angular Show All When No Filter Is Supplied
- Using pagination on a table in AngularJS
- State with different subviews
- Getting and passing MVC Model data to AngularJS controller
- Implementing prerender.io middleware in sails.js
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- AngularJS, Google App Engine and URLrewrite
- send data from table to another page into forms
- How to write tests for classes with inheritance
- angularJS sending OPTIONS instead of POST
- Receiving POST from external application in AngularJS
- Metaprogramming AngularJS Filters
- Reload List after Closing Modal
- Why is my angularjs site not completely crawlable?
- Why is separation of JavaScript and HTML a good practice?
Related Questions in SYNTAX
- Swift 2 - Pattern matching in "if"
- PHP designer 8 Syntax Highlighing
- Why does pattern "*.so?(.*)" produce a syntax error in a script but not on command line?
- Chaining in rails (ERB) files
- How to automate a process by pulling elements from a data frame in R -looping with a string?
- invalid syntax non specific error
- Is there any method or macro to simulate syntax "if(a <= b < c <= ...)" to replace "if(a<=b && b < c && c <= ...)"?
- Is "long long" = "long long int" = "long int long" = "int long long"?
- Syntax error python 2.7
- Java: get all method parameters as Object array
- Objective-C syntax: <>
- C++ - Why does 2 local references to the same object stay in sync?
- How to jump/display the column of an error
- Javascript syntax highlighter infinite loop
- Syntax Error when using 'delete'
Related Questions in DIRECTIVE
- Directive with transclude, data binding not working in templateUrl
- angular $firebaseArrray: difference between controller and directive
- Accessing data between controller directive and factory
- How to Change Color of Progress Bar Angular Directive
- Unit test case for angular directive to manipulate css
- Undefined property value in directive nested in ng-repeat
- Using current controller in directive with inheritence
- AngularJS: Directive with arbitrary start and end symbols
- Test access controller in angular directive
- AngularJS: Adding ng-click within element.append
- $scope gets null after calling template in directive
- How can I use special characters in angular directives attributes?
- AngularJS the width doesn't corespond
- Angular directive not watching
- How to Dynamically Append Custom D3/SVG Element in Angular
Related Questions in PLURAL
- How to make Grails 3 use plural routes by default
- JavaScript pluralize an english string
- How to handle pluralization in Hogan
- Localizable.stringsdict: getting English to use the "two" key
- How can I implement "natural" url scheme routing tables in ASP.NET MVC
- Plural and Singular terms in PHP
- Java - Grammar check not operating properly
- Translate toolkit : csv2po plural conversion is not formatted properly
- Django: Use a different related_name than "%(class)s" on abstract base classes to account for irregular plurals
- Pluralize in Rails View Issues
- IOS Swift Localisation Plural : compatibility with 14.4.2
- Syntax for plural label
- Internationalising sentences with two plural words
- Naming of overloaded methods - singular or plural?
- "localizedStringWithFormat" change the language without restarting the app
Related Questions in SINGULAR
- In python numpy least squares, why a singular normal matrix does NOT raise LinAlgError?
- numpy.linalg.inv returns inverse for a singular matrix
- How can I implement "natural" url scheme routing tables in ASP.NET MVC
- Plural and Singular terms in PHP
- Need help plotting this function in Matlab
- What causes "Jacobian matrix" to be singular in SAS?
- Linear regression with near singular matrix inversion
- Boundary (singular) fit in lmer
- Test if a word is singular or plural in Ruby on Rails
- Singular or Plural setting to a variable. PHP
- How to apply the colamd algorithm on a sparse matrix in python?
- despite singular.ok = FALSE, lm() reports a result while solve(t(X) %*% X) %*% (t(X) %*% y) reports (correctly) an error
- Java - Matrix is singular
- OpenModelica trivial mechanical system structurally singular
- fixed-effect model matrix is rank deficient so dropping 27 columns / coefficients AND boundary (singular)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Singular/plural is used just for common sense and code readability - it doesn't have to be singular/plural. You can do
and then have the
whateverobject available inside (like:<img ng-src="{{whatever.images[0]}}" />).In your case,
store.productscan't be changed since it refers to an actual object, whileproductis a completely custom name to be used in the repeat loop.Fairly common in programming. Like the other answer said, it's similar to the for..in syntax.