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 ...@@ -38,7 +38,7 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
if (form.$valid) { if (form.$valid) {
Generator.submit($scope) Generator.submit($scope)
.success(function(data){ .success(function(data){
$location.path("/crud"); $location.path($scope.form_params.model).search(data);
}) })
.error(function(data){ .error(function(data){
$scope.message = data.title; $scope.message = data.title;
...@@ -55,13 +55,18 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt ...@@ -55,13 +55,18 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeParams) { crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeParams) {
$scope.url = 'crud'; $scope.url = 'crud';
$scope.form_params = {"model": $routeParams.model}; $scope.form_params = {"model": $routeParams.model};
// call generator's get_list func
Generator.get_list($scope) if ($routeParams.nobjects){
.then(function (res) { $scope.nobjects = $routeParams.nobjects;
debugger; $scope.model = $routeParams.model;
$scope.nobjects = res.data.nobjects; } else {
$scope.model = $routeParams.model; // 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 () { ...@@ -90,7 +90,7 @@ app.directive('sidebar', ['$location', function () {
// todo: change to $watch to init // todo: change to $watch to init
$timeout(function(){ $timeout(function(){
$('#side-menu').metisMenu(); $('#side-menu').metisMenu();
}, 500); }, 2000);
$scope.selectedMenu = $location.path(); $scope.selectedMenu = $location.path();
$scope.collapseVar = 0; $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