角度6应用中的Js。它在Chrome
,Edge
和Firefox
中正常工作。 IE中的错误。
SCRIPT1010:预期的标识符 vendor.js(290527,19)
在进一步调试中,它显示
处的vendor.js错误// get all points within the passed range
function range ( ...args ) {
let options
if (isObj(args[args.length - 1])) {
let arg = args.pop()
// detect if that was a rect object
if (!args.length && (arg.x != null || arg.l != null || arg.left != null)) {
args = [arg]
options = {}
}
options = pick(arg, {
level: 'level maxLevel',
答案 0 :(得分:0)
当将Plotly与webpack一起使用(Angular CLI在内部使用)时,需要ify-loader(Webpack加载器按预期处理浏览器转换)。我改为使用@ angular-builders / custom-webpack:browser构建器,并将其添加到解决了该问题的webpack配置中。
main()
{
# initialize grid with Integer.MAX_VALUE or just a big enough number
# for Cell in Cells -> put obstacles on Grid as -1,
# find the Start and Goal and record them somewhere
# DFS_plus(array, Goal, 0);
# FindPath(list, array, Start);
# Done
}
void DFS_plus(array, row, column, distance):
if(array[row][col] <= distance) return; # There already exists a shorter path there
# or it's an obstacle, we store obstacles as -1.
# It's smaller than any possible path and thus blocks further search
array[row][column] = distance; # update distance.
# If this happened its neighbors will need to be updated too.
#Check for edge cases, or initialize array to be bigger and place obstacles on edge#
DFS_plus(array, row-1, column, distance+1); # You just map everything, no returns expected
DFS_plus(); # For all 4 directions
DFS_plus();
DFS_plus();
}
FindPath(list, array, row, col){
if(array[row][col] == 0) return; # It's the Goal
if(array[row-1][col] == (array[row][col] - 1)){ # Check if Cell above is 1 closer to Goal
list.add("MoveUp"); # Add direction
FindPath(list, array, row-1, col); # Look for next direction
return; # You don't need to check other directions as path is guaranteed
}
if(){}; # Check other directions if Up wasn't the one
if(){};
if(){};
}