question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advanced Router - HTML in sc-view not appearing

See original GitHub issue

I’ve been wrestling with this all day. If I put simple text inside <sc-view> then it shows the content. But if I add any html inside <sc-view> it won’t show, unless it’s the initial load of the page. I’ve been tinkering with _loadView in SCView. If I console out const newView it will show <sc-view> with all of the HTML properly inside. It appears that it’s breaking down somewhere in:

newView.childNodes.forEach(node => {
    this._view.appendChild(node);
});

this.appendChild(this._view);

Has anyone else experienced this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
surmacommented, Sep 28, 2016

Not using innerHTML was a conscious decision. Using innerHTML serializes the entire DOM to a string just to deserialize it right after. The current code should be doing exactly the same.

I took the current advanced-router code and changed line 38 of about/index.html to

<sc-view class="view-about visible" route="^/about/(.*)">
  <div>About <a href="x.com">lol</a></div>
</sc-view>

and it still works fine, both on initial page load as well as on navigation.

So I can’t reproduce, but I am curious as to what is going wrong on your end.

0reactions
itsMattShullcommented, Sep 28, 2016

I’ve made the changes in the pull request. I’ll go ahead and close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - HTML view not displaying after routing to module
I have a nested side navigation menu and the issue is that it routes to the specified module but the view is not...
Read more >
Develop Your First Extension - SuiteCommerce Developers
Go to Setup > SuiteCommerce Advanced > Extension Manager; Click New Activation; Select the appropriate web site and domain; Click on the ...
Read more >
Building the screw advance box joint jig - YouTube
A compilation of my box joint jig video series from 2012, edited down to one 20-minute video. http://woodgears.ca/box_joint/jig. html … Show ...
Read more >
Model View Controller (MVC) and Backbone.js
JavaScript must be enabled to correctly display this content ... Views do not define the HTML or CSS of a feature or component....
Read more >
Cisco Catalyst IR1101 Rugged Series Router Hardware ...
No antenna is shipped with the IR1101 by default. Items Shipped with your Router. Unpack the box and verify that all items listed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found