Skip to content

Commit f76a6b9

Browse files
committed
Merge pull request angular-ui#1389 from wrummler/master
Allow path-like strings to specify nested properties
2 parents 16f3a4b + c0c3e78 commit f76a6b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/coffee/directives/api/utils/model-key.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ angular.module('uiGmapgoogle-maps.directives.api.utils')
9494
if doWrap
9595
return {isScope: isScope, value: ret}
9696
ret
97-
scopeProp = scope[key]
97+
scopeProp = _.get scope, key
9898

9999
if _.isFunction scopeProp
100100
return maybeWrap true, scopeProp(model), doWrap
@@ -105,9 +105,9 @@ angular.module('uiGmapgoogle-maps.directives.api.utils')
105105

106106
modelKey = scopeProp #this should be the key pointing to what we need
107107
unless modelKey
108-
modelProp = model[key]
108+
modelProp = _.get model, key
109109
else
110-
modelProp = if modelKey == 'self' then model else model[modelKey]
110+
modelProp = if modelKey == 'self' then model else _.get model, modelKey
111111
if _.isFunction modelProp
112112
return maybeWrap false, modelProp(), doWrap
113113
maybeWrap false, modelProp, doWrap

0 commit comments

Comments
 (0)