Helloo, i created simple AngularJS application, i have two buttons(Create New Phone and Create New Category), i saved my categories into array use factory:
myApp.factory('categoriesStorage', function () {
var storage = [];
var categories = ["Apple","HTC"];
storage.addCategory = function (categoryTest) {
categories.push(categoryTest);
console.log(categories);
}
storage.getCategories = function()
{
return categories;
}
return storage;
});
At Add New Phone form i have dx-select-box
-element:
<div class="dx-label">Phone Name</div>
<div dx-select-box="nameOfPhone" ng-model="phoneName"></div><br/><br />
For Getting elements from array i use the next code in my HomeController.js //name of phone select-box pop-up
$scope.nameOfPhone = {
items: categoriesStorage.getCategories()
};
till when i change focus or close Add New Category form, new elements adds into array but don't displaying into select-box.
Thanks for your answers!