Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
675 views
in Technique[技术] by (71.8m points)

nativescript - Using Router for web and RouterExtensions for mobile in a single component

I am trying to code share in my project between a web and mobile app version.

I have a component that requires programmatic navigation and therefore I need to inject the Angular Router (from '@angular/router') for the web version and NativeScript RouterExtensions (from '@nativescript/angular') for the mobile version. Is there a recommended way to "dynamically" inject a dependency into a component, so that each target that is compiled for gets the correct dependency?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...