Angular2 routerLink on hyperlink - {outlets:{}} has to be the last command - angular2-routing

Just upgraded to latest angular2 version - however I am unable to just supply a normal link as per below:
<a [routerLink]="/home">Click it</a>
or
<a routerLink="/home">Click it</a>
The error is:
{outlets:{}} has to be the last command
I don't have a need for outlets, so just want to allow for a basic normal link - changing the hyperlink to a <button> works fine, it just seems to be on the hyperlink element.
I have not been able to find anything online with someone experiencing the same issue.
It was an existing project that was upgraded to latest angular, however I have a 2 others which went via the same process and they do not have this issue.
Any ideas?

Related

Visual Studio 2022 ASP.NET Core 6 Default application and Add folder to workspace in Chrome DevTools is not working anymore

After some update to either Visual Studio (I have the same issue in both VS2019 and VS2022) or Chrome I can no longer update the CSS in DevTools and have it reflect and persist the changes to site.css file in my project. Instead when I try to change a CSS property I get the following in the DevTools console:
Unable to find a stylesheet to update. Updating all local css files.
15:54:01.800 aspnetcore-browser-refresh.js:82
And the green dot disappears from my CSS pane immediately after I hit the up or down arrow on my keyboard to try and change the CSS value.
Why is that? It used to work not too long ago. I think it's been broken for me for half a year or so now.
I've been googling but haven't find any good resources. Or maybe I'm the only one coding directly in Chrome? :) Surely this can't be the case?
If anyone knows a workaround please share because I'm really frustrated atm :)
Disabling "Enable CSS Auto-Sync" seems to do the trick.
Update 1: The above no longer works for me for some reason. I managed to find another fix on SO: https://stackoverflow.com/a/70096917/687549
And here are some screenshots:
Update 2: Update 1 works when you only need to update the CSS directly in Chrome. It's better to have Hot Reload enabled and the set the following setting to None - then you'll get the best of both worlds (Hot Reload + Edit CSS directly in Chrome using workspaces): https://stackoverflow.com/a/68954979/687549
Update 3: I'm now using VSCode. If none of the above works try the following (block .js file in Network tab in Chrome DevTools): https://stackoverflow.com/a/68966524/687549

ASP.NET MVC doesn`t reload css file changes

currently, I am learning Bootstrap 4 at ASP.NET MVC project (only change index.cshtml, nothing else) in JetBrains Rider and I have some weird problem I can`t deal with.
Every day when I start to write new code in HTML it seems to be okay - dotnet watch run works great, inline styling is okay. But when I change site.css it doesn't see changes, I don't know why. After some time it fixes itself randomly (weird but ok), for example, yesterday I couldn't do anything with CSS until I ran the project in JetBrains Rider, but now it doesn't work. Two days ago it fixed itself when I wasn't using my computer (xD). Do you have any idea what's going on or how to fix it? I didn't find anything interesting on Google
P.S. I updated JetBrains IDE to the latest version but nothing is changed
Its browser-cache related. You should cache bust your css file ( add rand number or guid at the end of your css stylesheet declaration, ex : <link rel="stylesheet" href="style.css?v=3.4.1"> 3.4.1 should be generate randomly. ). Before doing that, you can also clear-cache or hard reload your page and you should see your changes.
Take a look at : https://css-tricks.com/strategies-for-cache-busting-css/

Tag links not working in beautifulhugo blog

I'm trying to build a blog using a combination of RStudio/blogdown and using the beautifulhugo theme from halogenica/beautifulhugo. When I create a new website using the stock template from github and the RStudio GUI/serve_site() everything works fine (as far as I can see) except the tags on the main page don't work (when I click them they say my computer isn't connected to the internet). I'd like to find out how to fix this... or learn how to work this properly, before I start changing stuff in the stock setup/building a blog.
This tag issue is repeated on each posts' page and on the dedicated "Tags" page when I click "View all" under each tag.
Am a complete noob here - am likely doing something wrong. I managed to "fix" the "View all" issue using https://github.com/halogenica/beautifulhugo/issues/142, but I'm guessing there is a more general issue with what I'm doing: I need to fix it once centrally, or perhaps perform a similar modification to other parts of the code?
Never mind - I found out what was wrong. The above fix corrects one of the issues in terms.html (layouts/_default). In the same folder there was an "error" (which I'll no doubt find out is correct at some point in the future) where there was an extra "/" being put into the tags link. I had to change
{{ . }}
to
{{ . }}
in both list/single.html in the same folder as above. Note these only differ in the slash before tags.

Polymer 1.0 google-analytics-query: Nothing is showing up

I am trying to develop a dashboard for my client where I have to use several google web components. My first approach is to show up a simple analytic query for which I am using this:
<google-analytics-query
ids="ga:xxxxxxxx"
metrics="ga:sessions"
dimensions="ga:country"
sort="-ga:sessions"
start-date="2015-10-01"
end-date="2015-10-31"
max-results="5">
</google-analytics-query>
But nothing is visible!
I am referring to https://elements.polymer-project.org/elements/google-analytics?active=google-analytics-query
What's going wrong?
UPDATE
I also tried the following code to render google-analytics-chart output ended up with a big white box.
<google-analytics-chart
type="area"
ids="ga:88814676"
metrics="ga:sessions"
dimensions="ga:date"
start-date="2015-10-01"
end-date="2015-10-31"
max-results="5">
</google-analytics-chart>
This question as also asked on the Github repo for the <google-analytics> element. You can see the answer there:
https://github.com/GoogleWebComponents/google-analytics/issues/29#issuecomment-157367824
The gist of the problem: using the <google-analytics-chart> element require authentication via the <google-signin> element in order to work.

Rails RSpec script fails to identify elements (update: because they are in iframe)

I am new to Rails and Selenium but have used other automated testing tools.
I exported a script from the Selenium 2 IDE to Rails/RSpec and am altering the code to get it to run. The script fails to find a specific link.
The original Ruby code as exported from the working IDE script was:
#driver.find_element(:link, "skip").click
This failed, so I attempted to identify the element with an XPath statement. (There were other elements that failed in the originally exported code that I fixed by using XPath, so that’s why I am using this strategy.)
I tried different alternatives to identify the link in the Ruby code, such as:
Attempt #1:#driver.find_element(:XPath, "//*[#class='skip-link']").click
Attempt #2:#driver.find_element(:XPath, "//*[#value='skip']").click
Result in all cases: Unable to locate element: {"method":"link text","selector":"skip"}
HTML reported per Firebug:
<a style="float: right; margin-right: 10px; text-decoration: none;" href="/yourfuture" class="skip-link"> skip </a>
XPath reported per Firebug:
/html/body/div[2]/div[2]/div/div/div[3]/div[4]/a
I have timeout set to 60 seconds and see the link skip displayed for several seconds before the script fails, so I don’t this is an issue.
One possibly relevant fact: when the app presents the window with all the controls, the skip does not appear initially. By program design, the app waits about 5 seconds before.
What am I doing wrong? Thanks in advance.
It turns out the link that was not seen was in an iFrame. The attributes of the iframe changed so it was difficult to identify it with a static property, so I just inserted the following line of code just before the line that Webdriver could not "see":
#driver.switch_to.frame(0)
I could have also used #driver.switch_to.frame("iframe-identifier-per-swtich") if there was a reliable way of identifying the iframe.
Yeah, you probably knew that but maybe this will help another newbie avoid the same problem.

Resources