From 20b6611107332b7cd36b93fc1398263c3ad328ae Mon Sep 17 00:00:00 2001 From: Ryan Schmukler Date: Tue, 24 Feb 2015 10:42:17 -0500 Subject: [PATCH] fix(select): support custom interpolate symbols closes #1590 --- src/components/select/select.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/select/select.js b/src/components/select/select.js index f9fbb5f8f2c..e9d83057281 100755 --- a/src/components/select/select.js +++ b/src/components/select/select.js @@ -65,7 +65,10 @@ angular.module('material.components.select', [ * * */ -function SelectDirective($mdSelect, $mdUtil, $mdTheming) { +function SelectDirective($mdSelect, $mdUtil, $mdTheming, $interpolate) { + var intStart = $interpolate.startSymbol(); + var intEnd = $interpolate.endSymbol(); + return { restrict: 'E', require: '?ngModel', @@ -78,11 +81,11 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming) { // If not provided, we automatically make one if (!labelEl.length) { - labelEl = angular.element('').html('{{' + attr.ngModel + ' !== undefined ? ' + attr.ngModel + ': \'' + attr.placeholder + '\'}}'); + labelEl = angular.element('').html('' + intStart + attr.ngModel + ' !== undefined ? ' + attr.ngModel + ': \'' + attr.placeholder + '\''+ intEnd + ''); } labelEl.append(''); labelEl.addClass('md-select-label'); - labelEl.addClass('{{ ' + attr.ngModel + ' ? \'\' : \'md-placeholder\'}}'); + labelEl.addClass(intStart + attr.ngModel + ' ? \'\' : \'md-placeholder\'' + intEnd); labelEl.attr('id', 'select_label_' + $mdUtil.nextUid()); // There's got to be an md-content inside. If there's not one, let's add it.