lib/assets/javascripts/material_raingular/directives/create/linkmodel.coffee in material_raingular-0.3.0 vs lib/assets/javascripts/material_raingular/directives/create/linkmodel.coffee in material_raingular-0.3.1
- old
+ new
@@ -1,6 +1,7 @@
# //= require material_raingular/directives/create/directive
+# //= require material_raingular/helpers/ng_model_parse
class MrCreateModel extends AngularLinkModel
@inject(
'$injector'
'$timeout'
'factoryName'
@@ -20,11 +21,10 @@
else
@_parentModel()[@_modelName()] = data
#Private
_modelPieces: ->
- @$attrs.mrCreate.split(/\.|\[/).map (piece) =>
- if piece.includes(']') then @$scope.$eval(piece.replace(/\]/,'')) else piece
+ Helpers.NgModelParse(@$attrs.mrCreate,@$scope)
_models: ->
models = [@$scope]
for piece,index in @_modelPieces()
models.push @$parse(piece)(models[index])
models