Commit b4e9bf32 authored by Evren Kutar's avatar Evren Kutar

v0.0.3.1

node and listnode add and edit screen fixes +
parent 93335551
......@@ -38,7 +38,7 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
if (form.$valid) {
Generator.submit($scope)
.success(function(data){
$location.path("/crud");
$location.path($scope.form_params.model).search(data);
})
.error(function(data){
$scope.message = data.title;
......@@ -55,13 +55,18 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeParams) {
$scope.url = 'crud';
$scope.form_params = {"model": $routeParams.model};
// call generator's get_list func
Generator.get_list($scope)
.then(function (res) {
debugger;
$scope.nobjects = res.data.nobjects;
$scope.model = $routeParams.model;
});
if ($routeParams.nobjects){
$scope.nobjects = $routeParams.nobjects;
$scope.model = $routeParams.model;
} else {
// call generator's get_list func
Generator.get_list($scope)
.then(function (res) {
$scope.nobjects = res.data.nobjects;
$scope.model = $routeParams.model;
});
}
});
/**
......
......@@ -90,7 +90,7 @@ app.directive('sidebar', ['$location', function () {
// todo: change to $watch to init
$timeout(function(){
$('#side-menu').metisMenu();
}, 500);
}, 2000);
$scope.selectedMenu = $location.path();
$scope.collapseVar = 0;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment