Render only shop tabs within shop

The include directive was listening to all $location paths including
`#login` which is unrelated to the shop tabs. Angular tried to load the
template `shop/login.html` which doesn't exist.

We now whitelist the templates that can be included by having an include
tag for each shop tab/page.
This commit is contained in:
Maikel Linke
2020-03-11 10:53:20 +11:00
parent ea80ae3832
commit a21ef19529

View File

@@ -11,4 +11,5 @@
.page{ "ng-class" => "{ selected: selected() == '#{tab[:name]}' }" }
%a{ href: "##{tab[:name]}" }=tab[:title]
.page-view{ "ng-include" => '"shop/" + selected() + ".html"' }
- shop_tabs.each do |tab|
.page-view{ ng: {include: "'shop/#{tab[:name]}.html'", if: "selected() == '#{tab[:name]}'" } }