3

有没有关于如何构建ionic apps on visual studio的教程?如何使用Visual Studio 2013社区创建离子应用程序?

有没有人用过ionic templates in VS?当我尝试打开该模板,我得到这个错误:

Ionic template not installing

This extension is not installable on any of the currently installed products.

如果我下载和安装通过​​模板(新项目的对话)我得到这个错误产生的后项目:

Issue after opening Ionic project

The imported (CordovaTools) project was not found

问题:我怎样才能得到那些.targets文件这里找不到VS?

回答

3

这是因为此模板现在只支持Visual Studio 2015 RC,但您使用的VS 12.0是VS2013。

[更新]

注:以下内容可以移动到博客或地方可以在未来共享给他人。

环境

工具:Visual Studio的2013更新为Apache科尔多瓦CTP 3.1

OS 4个+工具:Windows 8.1中的亲

主题:如何制定从离子出发https://github.com/driftyco/ionic-starter-tabs在Visual Studio 2013中的模板

步骤1:

在Visual Studio 2013中创建了一个新的空白Cordova App。

File-> New-> Project-> JavaScript-> Apache Cordova Apps - > Blank App(名为TestIonicTemplate)。

第2步:

https://github.com/driftyco/ionic-starter-tabs 打开网站http://code.ionicframework.com/#下载的模板。我们稍后会使用它。

第3步:

假设模板文件夹是离子型起动器的选项卡主,而该项目是TestIonicTemplate。然后开始将事情合并到VS项目中。

  1. 转到Visual Studio中,添加一个新的文件夹命名模板的 根项目文件夹下。

  2. 执行以下操作复制过去:从 将所有.js文件\离子起动器的选项卡主\ JS \到TestIonicTemplate \脚本移动从\离子起动器的选项卡主\模板所有 HTML文件到 TestIonicTemplate \模板

  3. 回到VS - >右键点击上面提到的文件夹 - > add->现有的项目。添加这些文件后,我们有以下 结构。

enter image description here

第4步:

执行以下操作修改VS项目的基础上,我们下载的模板中的index.html中的index.html。

  1. 添加参考ionic.css和ionic.bundle.js我们可以选择使用 本地副本或离子CDN,你可以得到所有的这些从 http://code.ionicframework.com/#我前面提到的。我在这里使用CDN。
  2. 删除对index.js的引用并添加对所有.js的引用我们 复制。
  3. 复制从\离子起动器的选项卡主\ index.html中的元线
  4. 附加“NG-应用=‘启动器’”在本体和删除缺省HTML 元件体。
  5. 复制从\离子起动器的选项卡主\ index.html的主体内容现在 我们有以下的index.html代码:

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
    <meta charset="utf-8" /> 
 
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
 
    <title>TestIonicTemplate</title> 
 

 
    <!-- TestIonicTemplate references --> 
 
    <link href="http://code.ionicframework.com/1.0.0/css/ionic.css" rel="stylesheet"> 
 
    <link href="css/index.css" rel="stylesheet" /> 
 
    <!-- ionic/angularjs js --> 
 
    <script src="http://code.ionicframework.com/1.0.0/js/ionic.bundle.js"></script> 
 
</head> 
 
<body ng-app="starter"> 
 
    <!-- 
 
     The nav bar that will be updated as we navigate between views. 
 
    --> 
 
    <ion-nav-bar class="bar-stable"> 
 
     <ion-nav-back-button> 
 
     </ion-nav-back-button> 
 
    </ion-nav-bar> 
 
    <!-- 
 
     The views will be rendered in the <ion-nav-view> directive below 
 
     Templates are in the /templates folder (but you could also 
 
     have templates inline in this html file if you'd like). 
 
    --> 
 
    <ion-nav-view></ion-nav-view> 
 

 
    <!-- Cordova reference, this is added to your app when it's built. --> 
 
    <script src="cordova.js"></script> 
 
    <script src="scripts/platformOverrides.js"></script> 
 

 
    <script src="scripts/app.js"></script> 
 
    <script src="scripts/controllers.js"></script> 
 
    <script src="scripts/services.js"></script> 
 
</body> 
 
</html>

这里是结果我在纹波看到:

enter image description here

+0

我正在使用VS 2013社区。难道它不支持[科尔多瓦](http://blogs.msdn。COM/B/somasegar /存档/ 2014/05/12 /移动第一云先发展-视觉工作室Apache的科尔多瓦-工装和 - 云优化的净futures.aspx)? – xameeramir

+1

VS 2013确实支持科尔多瓦。但你提到的模板不支持VS 2013.让我给你一些关于如何在以后创建离子cordova应用程序的步骤。我现在没有开发环境。 –

+1

检查我的更新。 –

2

我不太理解你的问题,但你可以使用Visual Studio Code(VSC)开发Ionic应用程序和其他web相关项目,它已经带有角度插件。

如果你的意思是说,如果VS可以创建离子项目,我不认为这是可能的。通过CMD /终端

  • NPM创建它安装-g科尔多瓦离子
  • 离子开始对myApp标签
  • CD对myApp
  • 离子平台加入IOS(或机器人)
  • 离子构建IOS(或机器人)
  • 离子模仿IOS(或机器人)

,然后通过哟打开它你最喜欢的IDE或文本编辑器开始开发。

+0

是的,我明白@JosephOcasio。这是我通过[guide](http://ionicframework.com/docs/guide/starting.html)完成的。我很想看到这个模板的工作。 – xameeramir

相关问题