How to achieve async routing with app-router in polymer application? - polymer

I need to check if the user is logged in prior to rendering the route's import - so async. I know flatiron-director supports this but how would it be achieved with app-router (https://github.com/erikringsmuth/app-router)?

Look at this issue, it might be helpful

Related

RequestContext udpate via PrimeFaces Selector (PFS)

Is it possible to update components via RequestContext with PFS? I have tried RequestContext.getCurrentContext().update("#(.some-class)"); but seems it does nothing (PF v6.0.18).
NO you cannot do that from the server side. From this announcement: https://www.primefaces.org/search-expression-framework/
NOTE:
Client side expressions are also NOT safe as server side expressions.
You could have a look at OmniFaces. It includes component utils which include methods to simplify searching them (compared to using the JSF spec API). It might help you to (more easily) find the components you need to update.

Library class doesn't know of ConfigureWebHostDefaults extension method

I'm building a suite of REST micro-services using .Net Core 3.0 Preview 6. All these services will have the same start up logic. So, I'm trying to place all the code in a .Net Standard library.
The goal is to have the IHostBuilder:CreateHostBuilder method, as well as the Startup:Configure and Startup:ConfigureServices class and methods in the library. The library will also contain error handling logic, customized http response messages, etc.
However, I can't seem to find the correct package that contains the ConfigureWebHostDefaults method. I tried adding the Microsoft.AspNetCore package 2.2.0, but that didn't resolve the issue.
I added the Microsoft.Extensions.Hosting (3.0.0-preview-6) package, that also doesn't resolve the issue.
Is what I'm attempting even possible?
Thanks
-marc
I resolved it, not the best way, but it works. I decided to make the library targeted specifically for .NET Core 3.0. So, I changed the targetframework in the project file. That change automatically resolved my other issue.
Import the Microsoft.AspNetCore package, and use WebHost.CreateDefaultBuilder() instead. According to the code it is built from, both CreateDefaultBuilder() and ConfigureWebHostDefaults() call the same internal method: ConfigureWebDefaults().
The only downside of this is that the returned host will be an IWebHost instead of an IHost.

Vuejs endpoint configuration

I'm really new in VueJS,
I use RxJS, Vue rx and Vue Resource in a mixin so i can make http calls and get observables back anywhere... awesome!
now i tried
subscriptions () {
return {
titles$: this.getHTTPObservable('https://jsonplaceholder.typicode.com/albums').flatMap(arr => Rx.Observable.from(arr).take(10).map(o => o.title).toArray())
}
The only thing i need now is to specify the end point of the server i am requesting in some configuration file like i would do in angular environments file. When launching the build by hand it should look like when i write
ng serve --env=dev
is there something similar?
Actually i found the answer on this page https://vuejs-templates.github.io/webpack/env.html
so, i can add any configuration variable and then call process.env.varname to get it back,
thanks
Vue.js normally works in conjunction with Webpack to achieve this.
https://v2.vuejs.org/v2/guide/deployment.html#With-Build-Tools
The DefinePlugin from Webpack is used for this. Outside of Webpack I think you are still able to use this:
https://www.npmjs.com/package/cross-env

Angular2 functions

Does there exists a build in function that keeps on reloading the whole component until a boolean gets true. Bacause now before I can get some data I need to wait until a user has clicked a button in another component. But there is no relationship between those 2 components.
Does someone knows a way how to do this.
thx!
you can make use of Event Emitters in components to share information so that you need not wait for a user dependent action . Also make use of Service classes in order to pass information between components.
https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#bidirectional-service
Also if you are getting information from a http call try and use observables or promises and then use ngIf or a elvus operator to get info into the component.
More on Angular Concepts https://rahulrsingh09.github.io/AngularConcepts/
I solved it by using a service where is create a subject/observable.
Check the link:
https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#bidirectional-service
check the: Parent and children communicate via a service

System.WindowsRuntimeExtensions missing?

I'm trying to expose an async method via a windows RT component to my consuming JS.
Without going into too much initial detail, some of the articles I've read point to an extension method AsAsyncOperation() which should be available on Task<T> (example article here: http://marcominerva.wordpress.com/2013/03/21/how-to-expose-async-methods-in-a-windows-runtime-component/ )
Here's the MSDN link for it, so I know it should exist!:
http://msdn.microsoft.com/en-gb/library/system.windowsruntimesystemextensions.aspx
What is confusing me at the moment is that I simple don't seem to have the 'AsAyncOperation' function at all.
Is there anything I need to do to ensure these extension methods are available?