关于wpf的CefSharp嵌入网页,与angularjs交互问题
H5网页放一个登陆按钮,angularjs中
$scope.login = function () {
window['wpfToAngularObj'].angularToWPF('123');
}
wpf#
CefSharpSettings.LegacyJavascriptBindingEnabled = true;
webView.JavascriptObjectRepository.Register("boundAsync", new WPFAngularObj(), isAsync: true, options: BindingOptions.DefaultBinder);
webView.Address = "http://localhost:8999/home.html#/login";
public class WPFAngularObj
{
public void angularToWPF(string msg)
{
MessageBox.Show(msg);
}
}
一直无法调用到wpf的方法。CefSharp提示Cannot read property 'angularToWPF' of undefined 找不到angularToWPF