More route work and directive

This commit is contained in:
Ken Hoes 2016-03-18 15:22:41 -04:00
parent 66b96ced38
commit 632f3ca567
8 changed files with 67 additions and 27 deletions

View File

@ -437,12 +437,14 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis',
'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize',
'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', 'ScopePass',
function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON,
ParseVariableString, CreateDialog, TextareaResize) {
ParseVariableString, CreateDialog, TextareaResize, ScopePass) {
return function(params) {
ScopePass.set(params);
var passing = ScopePass.get();
console.info(passing);
var parent_scope = params.host_scope,
group_scope = params.group_scope,
host_id = params.host_id,

View File

@ -1,7 +1,6 @@
<div class="tab-pane" id="inventory_edit">
<ui-view/>
<div ui-view class="manage">In the ui view
<manage-hosts></manage-hosts>
<div ui-view="manage" class="manage">
</div>
<div ng-cloak id="htmlTemplate">

View File

@ -11,9 +11,9 @@ import manageHostsDirective from './manage-hosts/manage-hosts.directive';
import manageHostsRoute from './manage-hosts/manage-hosts.route';
export default
angular.module('inventoryManage', [])
angular.module('inventoryManage', [])
.directive('manageHosts', manageHostsDirective)
.run(['$stateExtender', function($stateExtender) {
$stateExtender.addState(route);
$stateExtender.addState(manageHostsRoute);
}]);
.run(['$stateExtender', function($stateExtender) {
$stateExtender.addState(route);
$stateExtender.addState(manageHostsRoute);
}]);

View File

@ -0,0 +1,13 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import route from './manage-hosts.route';
export default
angular.module('manageHosts', [])
.run(['$stateExtender', function($stateExtender) {
$stateExtender.addState(route);
}]);

View File

@ -5,16 +5,18 @@
*************************************************/
function manageHostDirectiveController($q, $rootScope, $scope, $state,
$stateParams, $compile, Rest, ProcessErrors,
$stateParams, $compile, ScopePass, Rest, ProcessErrors,
CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit,
PaginateInit, GetRootGroups) {
var vm = this;
var vm = this;
console.info(ScopePass);
};
};
export default ['$q', '$rootScope', '$scope', '$state', '$stateParams',
'ScopePass', '$compile', 'Rest', 'ProcessErrors', 'CreateDialog',
'ScopePass', '$compile', 'ScopePass', 'Rest', 'ProcessErrors', 'CreateDialog',
'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
'PaginateInit', 'GetRootGroups', manageHostDirectiveController
'PaginateInit', 'GetRootGroups',
manageHostDirectiveController
];

View File

@ -17,9 +17,9 @@ export default ['templateUrl',
link: function(scope, element, attrs) {
},
// controller: manageHostsController,
// controllerAs: 'vm',
// bindToController: true
controller: manageHostsController,
controllerAs: 'vm',
bindToController: true
};
}
];

View File

@ -4,23 +4,31 @@
* All Rights Reserved
*************************************************/
import {
templateUrl
} from '../../../shared/template-url/template-url.factory';
// import {
// templateUrl
// } from '../../../shared/template-url/template-url.factory';
import manageHostDirectiveController from './manage-hosts.controller'
export default {
name: 'inventoryManage.manageHosts',
route: '/managehosts',
template: 'SOMETHING',
//template: '<div>SOMETHING</div>',
views: {
"manage@inventoryManage" : {
template: '<div>the template from route</div>'
}
},
// data: {
// activityStream: true,
// activityStreamTarget: 'inventory',
// activityStreamId: 'inventory_id'
// },
// ncyBreadcrumb: {
// label: "INVENTORY MANAGE"
// },
ncyBreadcrumb: {
label: "INVENTORY MANAGE"
},
controller: manageHostDirectiveController,
// resolve: {
// features: ['FeaturesService', function(FeaturesService) {
// return FeaturesService.get();

View File

@ -871,4 +871,20 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
};
}
]);
])
.factory('ScopePass', function() {
var savedData = {}
function set(data) {
savedData = data;
}
function get() {
return savedData;
}
return {
set: set,
get: get
}
});