0
我用ngstorage保存在localStorage的一些值 我contrroller是:綁定到下拉
app.controller("main", function($scope, $localStorage) {
$scope.$storage = $localStorage.$default({
selectedlanguage: { language: null, text: "All Languages" }
});
$scope.languages = [
{ language: null, text: "All Languages" },
{ language: "en", text: "English" },
{ language: "ar", text: "Arabic" }
];
}
我的觀點是:
<select ng-model="$storage.selectedlanguage" ng-options="lang.text for lang in languages">
</select>
重新加載該頁面角的selectedlanguage不能結合時 在此先感謝
謝謝。你回答解決我的問題:) –
很高興幫助@beshoysemsem! –