From a21ef195296d685d2c02b787825a4e138ed1d505 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 11 Mar 2020 10:53:20 +1100 Subject: [PATCH] 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. --- app/views/shopping_shared/_tabs.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index eb663613a5..4f6a2192ea 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -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]}'" } }