是否有可能创build一个网站和混合的应用程序(使用离子)相同的代码库,而无需重写任何东西

我想创build一个网站与其混合应用程序使用离子,我查了离子的文档http://ionicframework.com/getting-started/ ,我创build了一个离子应用程序的标签,但我也想处理我的网站,所以如果请求来自网页,那么普通的HTML应该像基础的web框架一起服务,我不想重复移动和网页的代码。 当我检查由离子产生的文件,它看起来像这样

<ion-modal-view> <ion-header-bar> <h1 class="title">Login</h1> <div class="buttons"> <button class="button button-clear" ng-click="closeLogin()">Close</button> </div> </ion-header-bar> <ion-content> <form ng-submit="doLogin()"> <div class="list"> <label class="item item-input"> <span class="input-label">Username</span> <input type="text" ng-model="loginData.username"> </label> <label class="item item-input"> <span class="input-label">Password</span> <input type="password" ng-model="loginData.password"> </label> <label class="item"> <button class="button button-block button-positive" type="submit">Log in</button> </label> </div> </form> </ion-content> </ion-modal-view> 

所以有可能使用相同的代码的networking和应用程序(基础的networking和离子的应用程序)

是的你可以! 你可以使用离子平台添加浏览器,然后你需要添加到你的节点js服务器。

离子作为networking服务器