创建使用angularjs一个窗口通用的应用程序 [英] Create a windows universal app using angularjs

查看:98
本文介绍了创建使用angularjs一个窗口通用的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个angularjs窗户通用的应用程序?

How to create a windows universal app with angularjs?

我创建使用Visual Studio的一个万能的Windows应用程序,(手动和的NuGet出于测试目的,我亭子尝试了不同的方式)增加了角脚本,总是得到无法添加动态内容。

I created an universal windows app using visual studio, added the angular script (for testing purposes, I tried it on different ways with bower, manually and with nuget) and always get "Unable to add dynamic content".

在搜索这个我发现很多链接试图解释如何解决这个错误,例如:的 http://blog.kadople.com/2013/06/getting-started-with-angularjs-in.html 。但是,这一切似乎是很丑陋的或不工作 - 至少不适用于Windows普遍应用。提到链接的演示应用程序的工作,但所涉及黑客攻击周围的jQuery code添加execUnsafeLocalFunction那是我真的不想做的事。我认为,这应该与jQuery版本> = 2.0是工作 - 但确定,它不是

Searching for this I found a lot of links trying to explain how to get around this error, for example: http://blog.kadople.com/2013/06/getting-started-with-angularjs-in.html. But it all seems to be very ugly or not working at all - at least not for windows universal apps. The demo app of the link mentioned is working but that involved hacking around in jquery code adding execUnsafeLocalFunction and that is something I really don't want to do. And I think this should be working with jquery version >= 2.0 - but ok, it is not.

我们怎样才能使这个应用程序万能? ;)

How can we make this app "universal"? ;)

推荐答案

一个很好的解决方案这个问题是 WinStore-JsCompat在项目的。只是包括它,你.html文件的所有其他脚本之前添加一个引用,你是好去。

A great solution to this problem is to WinStore-JsCompat in your project. Just include it and add a reference in you .html file before all other scripts and you're good to go.

这篇关于创建使用angularjs一个窗口通用的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆