问题描述
我从MVC背景的,并在最近使用angularjs开始发展。
我使用Visual Studio的开发的WebAPI使用MVC从angularjs。
托管的WebAPI的基本模板我从采摘:
I am coming from MVC background and has recently started development using angularjs.I am using Visual Studio for the WebApi development and using MVC from angularjs.The basic template for hosting webapi i had picked from: here
但现在我没有任何办法为缩小与放大器;捆绑销售,这将在生产中大大阻碍应用程序加载时间。 有没有办法使用的缩小和放大器;与angularjs&放捆绑;不用的WebAPI使用MVC。
But now i dont have any way for minification & bundling, which would in production drastically hamper the app load time. Is there any way to use minification & bundling with angularjs & webapi without using MVC.
在寻找解决方案我碰到问世,这似乎为拯救了我。现在,我有对的WebAPI和angularjs独立的项目。我使用的构建与放大器的node.js;测试目的。 NPM安装在角项目及放包;的NuGet安装任何依赖关系的WebAPI项目。现在,我可以做所有的开发在Visual Studio。
While looking for solution i came across "Node.Js Tools for Visual Studio" which seems to came to my rescue. Now i am having separate projects for webapi and angularjs. i am using node.js for build & testing purposes. npm for installing packages in angular project & nuget for installing any dependencies for webapi project. Now, I can do all the development in visual studio.
但是,我还是不知道几件事情:
But I am still not sure about few things:
-
我怎样之间的WebAPI和功放连接; angularjs。我需要在angularjs不同的端口来同时承载并做CORS。
how do i make connect between webapi & angularjs. i need to host both in different ports and do the CORS from angularjs.
如果我作出的WebAPI的改变,我将不得不再次举办,然后测试...有没有简单的方法呢?
if i make a change in webapi, will i have to host it again and then test it... is there no easy way out?
顺便说一下,Visual Studio中的node.js结合 - 是一个坏主意?我应该跟上的WebAPI,并在同一个Visual Studio项目angularjs和使用MVC捆绑,缩小了MVC ......所以我不担心托管&安培;部署。
Btw, combining visual studio with node.js - is that a bad idea? should i keep the mvc with webapi and angularjs in same visual studio project and using mvc bundling-minification... so i am not worried about hosting & deployment.
请注意:我使用NHibernate和必须与Oracle连接。还有没有其他的选择,我可以尝试的WebAPI除了它可以使事情变得更容易。
Note: I am using NHibernate and have to connect with Oracle. is there any other option that i can try apart from webapi which can make the things easier.
对不起,我对整体水平的事情是如何工作的。如何做到这些线程结合起来,并感谢帮助我认识不足。我已经做了足够的谷歌搜索,但没有能够找到一个解决方案。如果有人能指出我的一些文章将是巨大的。
Sorry for my lack of knowledge on how the things on overall level works.. how do these threads combine, and thanks for helping me out. I have done enough googling but was not able to find out a solution. if somebody can point me to some articles it would be great.
推荐答案
终于,我得到了答案。它非常非常容易做到这一点,就没有文章这一点。读到这里
finally, I got the answer to this. Its very very easy to do it, just that there is no article for this. read about it here
这篇关于如何将这些angularjs时,Visual Studio和功放结合起来;的NodeJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!