Questo è un problema che è già stato discusso GitHub
Basta dare un'occhiata a questo
Working Demo
html
<div ng-app='myApp' ng-controller="Controller">
<label for="browsers">Pick A Name:</label>
<form name="myForm">
<select dselect required id="browsers" ng-model="selectValue" ng-options="browser for browser in browsers">
<option value="">Select One</option>
</select>
<br>
<button ng-click="submit()" ng-disabled="!myForm.$valid">submit</button>
</form>
<br>
<br>You Selected: {{selectValue || "You didn't pick"}}</div>
</div>
sceneggiatura
var app = angular.module('myApp', []);
app.controller('Controller', function ($scope) {
$scope.browsers = ['Manu', 'Mathew', 'Sunny'];
$scope.submit = function() {
alert("submit");
}
});
if (navigator.userAgent.indexOf("Sunny") !== -1) {
app.directive("select", function() {
return {
restrict: "E",
require: "?ngModel",
scope: false,
link: function (scope, element, attrs, ngModel) {
if (!ngModel) {
return;
}
element.bind("keyup", function() {
element.trigger("change");
})
}
}
})
}
fonte
2014-05-09 11:55:06
Potete creare un violino o plunker? Questo aiuterà a identificare il problema. – Satpal
Questo è un bug noto: https://github.com/angular/angular.js/issues/4216#issuecomment-25872117 Soluzione: http://plnkr.co/edit/ccL4Y1LWSOz22o6SZHLS? p = preview – Dieterg
https://github.com/angular/angular.js/issues/2616 Quale versione di angolare usi? Questo è successo solo in Firefox, ma anche in Chrome? – Getz