pathfinder-ui
Advanced tools
Comparing version 0.1.134 to 0.1.135
@@ -1,2 +0,2 @@ | ||
app.controller('TabBtnsController', function($scope, $state){ | ||
app.controller('TabBtnsController', function($scope, $state, $mdTabsCtrl){ | ||
@@ -7,3 +7,5 @@ //Put the state name of the tabs in the array below. | ||
{name:"The third tab", directive:'tab3'}, | ||
{name:"The fourth tab", directive:'tab4'}] | ||
{name:"The fourth tab", directive:'tab4'}]; | ||
$mdTabsCtrl.shouldPaginate = true; | ||
}) |
@@ -6,4 +6,4 @@ var example = require('./example'); | ||
pathfinderUI.router = pfroute; | ||
function pathfinderUI (app){ | ||
@@ -15,13 +15,16 @@ | ||
function generateRouteTree(app) { | ||
var routeObj = {}; // create tree object | ||
var topLevelRouteStack = app._router.stack; | ||
return retrieveRoutes(topLevelRouteStack); | ||
var routes = retrieveRoutes(topLevelRouteStack); | ||
routeObj["name"] = "APP"; | ||
routeObj["children"] = routes; | ||
return routeObj; | ||
} | ||
function retrieveRoutes (topLevelRouteStack, parentPath) { | ||
// var topLevelRouteStack = app._route.stack; | ||
var allRoutes = []; | ||
var pPath = "" | ||
if(parentPath) pPath = parentPath | ||
var pPath = ""; | ||
if(parentPath) pPath = parentPath; // saving so we can get child route's full path | ||
var routesArray = topLevelRouteStack.filter(function(stack){ // filter out middleware | ||
var routesArray = topLevelRouteStack.filter(function(stack){ // filter out unwanted middleware | ||
return stack.route || stack.handle.stack; | ||
@@ -34,11 +37,6 @@ }); | ||
// console.log("ROUTE PATH:", e.route.path, "ROUTE STACK", e.route.stack, "ROUTE STACK[0] METHOD", e.route.stack[0].method); | ||
var route = { path: pPath + e.route.path, method: e.route.stack[0].method }; | ||
var route = { name: pPath + e.route.path, method: e.route.stack[0].method }; | ||
allRoutes.push(route); | ||
} else if (e.handle.stack) { // if subrouter exists | ||
//console.log(e.handle.stack); | ||
//{path: grab pathname from the regex exp, method: router} | ||
// test/api | ||
// console.log('something wrong here?',e.regexp.toString().slice(0, -1), e); | ||
var parentName = ''; | ||
@@ -49,28 +47,26 @@ if (e.regexp.test('/')){ | ||
else { | ||
parentName = e.regexp.toString().slice(0, -1).match(/\w+/ig).join("/"); | ||
} | ||
//var parentPath = pPath + "/" + e.regexp.toString().slice(0, -1).match(/\w+/ig).join("/"); | ||
var parentPath = pPath + parentName; | ||
//console.log("pName", parentName); | ||
var parentPath = pPath + "/" + parentName; | ||
var route = {}; | ||
route[parentName] = []; | ||
route["name"] = parentName; | ||
route["children"] = []; | ||
// allRoutes.push({path: parentName, method: "router"}) | ||
var subRouterStack = e.handle.stack; // if route is in the handle's stack, retrieve those routes | ||
route[parentName] = retrieveRoutes(subRouterStack, parentPath); | ||
// console.log("SUBROUTES", subRoutes); | ||
// allRoutes.push(subRoutes) | ||
route["children"] = retrieveRoutes(subRouterStack, parentPath); | ||
allRoutes.push(route); | ||
} else { | ||
console.log("missed a case"); | ||
console.log("missed a case"); // for edge cases | ||
} | ||
}); | ||
//console.log(allRoutes); | ||
return allRoutes | ||
return allRoutes; | ||
} | ||
} | ||
} | ||
pathfinderUI.router = pfroute; |
@@ -12,10 +12,6 @@ // Created By: Sangmin Lee | ||
pfrouter.get('/', function(req, res){ | ||
console.log("hit route") | ||
res.sendFile('./index.html'); | ||
pfrouter.get('/data', function(req, res){ | ||
res.send(req.RESTroutes); | ||
}); | ||
pfrouter.get('/data', function(req, res){ | ||
res.send(req.RESTroutes) | ||
}) | ||
module.exports = pfrouter; |
{ | ||
"name": "pathfinder-ui", | ||
"version": "0.1.134", | ||
"version": "0.1.135", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "preferGlobal": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
109564
22
1137
1