Last active
April 13, 2018 23:04
-
-
Save awkale/52ca7e8ed175af78ae816b5b591a8d2a to your computer and use it in GitHub Desktop.
angular cheatsheet #angularjs #cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find an object in an array based on object property | |
var objArray = [ | |
{ id: 0, name: 'Object 0', otherProp: '321' }, | |
{ id: 1, name: 'O1', otherProp: '648' }, | |
{ id: 2, name: 'Another Object', otherProp: '850' }, | |
{ id: 3, name: 'Almost There', otherProp: '046' }, | |
{ id: 4, name: 'Last Obj', otherProp: '984' } | |
]; | |
$filter('filter')(objArray, {id: 3}, true)[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment