我在Angular2教程中遇到以下错误.TNS医生还可以,为什么会出现以下错误?
'tns livesync ios --emulator --watch
Executing before-prepare hook from /Users//Documents/frontend/sample-Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared (ios)
Executing before-livesync hook from /Users//Documents/frontend/sample-Groceries/hooks/before-livesync/nativescript-angular-sync .js
Transferring project files...
Successfully transferred all files.
Applying changes...
Successfully synced application org.nativescript.groceries on device D28D29C3-07B6-4B60-B4B0-711475C505DE.
Executing before-watch hook from /Users//Documents/frontend/sample-Groceries/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 1 0x105cd08d7 -[TNSRuntime executeModule:]
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 2 0x10587b6d2 main
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 3 0x109be668d start
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: …Run Code Online (Sandbox Code Playgroud) 升级了我的package.json中的一些项目后,我突然得到:
Error: com.tns.NativeScriptException: Failed to find module: "stream", relative to: /app/tns_modules/
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.naturesnotebookmobile/files/app/tns_modules/parse5/lib/parser/stream.js', line: 3, column: 22
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?以前我所有角度的东西都是2.0.0,然后就可以了.这是我的package.json:
{
"dependencies": {
"@angular/common": "2.1.0",
"@angular/compiler": "2.1.0",
"@angular/core": "2.1.0",
"@angular/forms": "2.1.0",
"@angular/http": "2.1.0",
"@angular/platform-browser": "2.1.0",
"@angular/platform-browser-dynamic": "2.1.0",
"@angular/platform-server": "2.1.0",
"@angular/router": "3.1.0",
"crypto-js": "^3.1.7",
"nativescript-angular": "1.1.0",
... a few other things here...
"node-geocoder": "^3.15.0",
"oauth-signature": "^1.3.1",
"reflect-metadata": "^0.1.8",
"tns-core-modules": "2.3.0",
"util": "^0.10.3"
},
"devDependencies": {
"babel-traverse": "6.16.0",
"babel-types": "6.16.0",
"babylon": "6.12.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": …Run Code Online (Sandbox Code Playgroud) 如何在angular 1中实现类似element指令的组件?
这是我的代码,但是不起作用:
import {Component} from "@angular/core";
@Component({
moduleId: "TestComponent",
selector: "TestComponent",
template: '<Label text="TEST COMPONENT" textWrap="true"></Label>'
})
export class TestComponentComponent {
constructor() { }
}
@Component({
selector: "my-app",
template: `
<StackLayout>
<Label text="TEST"></Label>
<TestComponent></TestComponent>
</StackLayout>
`
})
export class AppComponent {
constructor() { }
}
Run Code Online (Sandbox Code Playgroud) 我必须为IOS和Android创建移动应用程序.我对使用NativeSript问题很感兴趣,UI非常复杂,我不确定这个框架是否会管理它.因为我使用Js和Java的工作不是问题,我已经准备好后端了.
最好的问候卢克
我使用以下命令将android平台添加到我的nativescript应用程序
tns platform add android
现在我无法弄清楚该平台的哪个API版本被添加了?
我怎么能搞清楚这一点?
我正在使用nativescript创建一个表单,我希望我的字段有像TextInputLayout一样的浮动提示,我发现这个插件nativescript-textinputlayout技术上完全符合我的要求,但问题是我使用我的应用程序使用了角度2,并且我似乎无法弄清楚如何使用角度为2的插件.有人可以帮忙吗?除了使用插件实现浮动提示之外,我还对其他解决方案持开放态度
android nativescript android-textinputlayout angular2-nativescript
我需要为我的nativescript角度应用构建一个多项目选择UI元素。似乎没有支持多种选择的nativescript UI组件。关于如何为我的应用程序实现此功能的任何示例?
我如何将我的Tabview项停靠在屏幕的左侧,如下图所示?
<TabView dock="left" tabsBackgroundColor="red" selectedIndex="1" selectedColor="#FF0000" iosIconRenderingMode="alwaysOriginal" sdkExampleTitle sdkToggleNavButton>
<StackLayout tabsBackgroundColor="red" *tabItem="{ iconSource: 'res://ic_ham'}" >
</StackLayout>
<StackLayout *tabItem="{title: 'Home'}">
<ns-home></ns-home>
</StackLayout>
<StackLayout *tabItem="{title: 'Bookings'}">
<ns-booking></ns-booking>
</StackLayout>
</TabView>
Run Code Online (Sandbox Code Playgroud)
结果布局
我正在尝试设置nativescript开发环境.我按照官方文件中描述的步骤进行操作.链接
之后我通过使用创建了一个新项目
tns create my-first-app --template tns-template-hello-world-ng
Run Code Online (Sandbox Code Playgroud)
然后我使用以下命令添加了iOS和Android平台
tns platform add ios
tns platform add android
Run Code Online (Sandbox Code Playgroud)
执行时
tns run android
Run Code Online (Sandbox Code Playgroud)
一切正常.模拟器正在启动,应用程序打开.
但是,在跑步时
tns run ios
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Searching for Devices...
spawn EACCES
Run Code Online (Sandbox Code Playgroud)
我已经尝试更改app目录的权限
sudo chmod -R a+rwx /[AppFolder]
Run Code Online (Sandbox Code Playgroud)
执行
sudo tns run ios
Run Code Online (Sandbox Code Playgroud)
没有解决问题
编辑2017-10-5 回应Nikolai Tsonevs回答:
执行以下命令,并没有解决问题:
tns platform remove ios
npm cache clean --force
tns platform add ios
tns run ios
Run Code Online (Sandbox Code Playgroud)
我的节点版本是:v8.4.0我的npm版本是:5.4.2
我还执行以下操作与你分享输出(假设,尼古拉意味着ios而不是android):
tns platform remove ios
tns platform add ios --log trace > out.txt
Run Code Online (Sandbox Code Playgroud)
这是输出: …
在打字稿上使用push方法时,我遇到问题,详细信息在这里
这是我的保留模态组件代码:
guestArray=[1, 2, 3, 4, 5, 6];
guests: number;
isDateTime: boolean = false;
constructor(private params: ModalDialogParams,
private page: Page) {
if(params.context === "guest") {
this.isDateTime = false;
}
else if(params.context === "date-time") {
this.isDateTime = true;
}
}
ngOnInit() {
if (this.isDateTime) {
let datePicker: DatePicker = <DatePicker>this.page.getViewById<DatePicker>('datePicker');
let currentdate: Date = new Date();
datePicker.year = currentdate.getFullYear();
datePicker.month = currentdate.getMonth() + 1;
datePicker.day = currentdate.getDate();
datePicker.minDate = currentdate;
datePicker.maxDate = new Date(2045, 4, 12);
let timePicker: TimePicker = <TimePicker>this.page.getViewById<TimePicker>('timePicker'); …Run Code Online (Sandbox Code Playgroud)