Angular <option> for null在salesforce.com中不起作用</option>

时间:2014-02-19 17:37:50

标签: angularjs salesforce

在salesforce.com Visualforce页面中,未显示null的默认选项值。我有一个非常简单的选择组件,其中一个选项子元素用于Angular Docs(http://docs.angularjs.org/api/ng/directive/select)定义的none或null值。

这是应用程序:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js"/>
<script>
    var myApp = angular.module('myApp',[]);

    function MyCtrl($scope) {
        $scope.colors = [
            {name:'black', shade:'dark'},
            {name:'white', shade:'light'},
            {name:'red', shade:'dark'},
            {name:'blue', shade:'dark'},
            {name:'yellow', shade:'light'}
        ];
    }
</script>

<div ng-app="myApp">
    <div ng-controller="MyCtrl">
        <select ng-model="color" ng-options="c.name for c in colors">
            <option value="">-- choose color --</option>
        </select>   
        {{color.name}}
    </div>
</div>

正如您在此页面上看到的http://geopointedev-developer-edition.na14.force.com/angularoption,“ - 选择颜色 - ”选项不会显示。但是在这个jsfiddle,http://jsfiddle.net/MTfRD/670/,它运作得很好。有关为什么none选项未在salesforce.com Visualforce页面中显示的任何想法?

0 个答案:

没有答案