我有一个名为'results'的父状态和两个子状态'results.grid'和'results.list'。
<a ui-sref="results.grid">Grid</a>
<a ui-sref="results.list">List</a>
<div ui-view></div>
main_listing.html有
with open(FILEPATH, 'r') as f:
current_line = None
for line in f:
line = line.strip()
if line.startswith('Code-'):
# new company
if current_line is not None:
print(current_line)
# create a line that starts with 'CodeXXXX - '
current_line = line.replace('-', '').replace('+', '') + ' - '
else:
current_line += line
current_line += ' '
我已经使用redirectTo和$ stateChangeStart默认加载'results.grid',当加载'results'时,这个问题中接受的答案给出了 - ui-router default child state not working
这完全没问题。但当我在'results.list'并且我重新加载页面时,它不会保留在'results.list'中,它会被重定向到'results.grid'。
如何防止此行为?