我知道如何使用 ComponentFactoryResolver.resolveComponentFactory(AComponentType)
但该方法需要a Type,而在我的代码中,该类型的名称为a string。
在Angular API中,有没有一种方法可以解决string?如果没有,如何Type在TypeScript中将字符串转换为?
万一以上都不可行,我将求助于地图,但它并不是那么简单,因为我需要实例化的组件将来自远程获取的UMD角度组件库。
I have my Spring Boot application, that provides some rest endpoints. Those rest endpoints need security, and I want to use the Oauth2 for it.
My idea is to use Google oauth2 token for that. I don't want to provide login functionality in my Spring Boot app, so I just want to check that the Bearer token is there and get the user info from it to display his/her data accordingly.
I'm checking this tutorial, but I don't think it's …
在Javascript中,如果我有一个这样的字符串:"你好,很高兴认识你"我想要回到我身边的是奇怪的地方所以我会得到:"你好,你好"
我怎么能为此编写代码?
这是我的代码,实际上当我点击功能但没有显示警报而没有在控制台中收到错误.所以请告诉我该怎么做.
HTML代码
<li class="has-megamenu" ng-click="homepage()" ><a ><span >Home</span></a>
</li>
Run Code Online (Sandbox Code Playgroud)
app.js
app.controller('myController', function($scope){
$scope.homepage = function(){
alert('hi');
}});
Run Code Online (Sandbox Code Playgroud) javascript ×2
algorithm ×1
angular ×1
angular5 ×1
angularjs ×1
arrays ×1
components ×1
html ×1
java ×1
oauth-2.0 ×1
spring-boot ×1
typescript ×1
umd ×1