首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >很难在RadListView中使用NativeScript

很难在RadListView中使用NativeScript
EN

Stack Overflow用户
提问于 2016-06-15 15:10:33
回答 1查看 1.1K关注 0票数 1

这是我第一次在StackOverflow上问问题,所以我可能听起来很奇怪。请容忍我。所以,我正在用NativeScript和TypeScript编写一个程序。我想在本地文本-telerik中使用RadListView,但它并不完全起作用。

这就是我的app.component.ts的样子:

代码语言:javascript
复制
import {Component} from "@angular/core";
import {RouteConfig} from "@angular/router-deprecated";
import {HTTP_PROVIDERS} from "@angular/http";
import {NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS} from "nativescript-angular/router";

import {test} from "./pages/test.component";

@Component({
selector: "main",
    directives: [NS_ROUTER_DIRECTIVES],
    providers: [NS_ROUTER_PROVIDERS, HTTP_PROVIDERS],
    template: "<page-router-outlet></page-router-outlet>"
})
@RouteConfig([
    { path: "/test", component: test, name: "test", useAsDefault: true }
])
export class AppComponent {}

这是我的test.component.ts

代码语言:javascript
复制
import {Component, ViewChild, ElementRef, OnInit} from "@angular/core";
import {Page} from "ui/page";

@Component({
    selector: "test",
    templateUrl: "pages/test.html",
    styleUrls: ["pages/test-common.css", "pages/test.css"],
    providers: []
})

export class test implements OnInit {

    constructor(private page: Page) {}

    ngOnInit() {}

}

这是我的test.html

代码语言:javascript
复制
<ActionBar title="RadListView"></ActionBar>

<lv:RadListView id="list-view" items="{{ items }}" xmlns='http://schemas.nativescript.org/tns.xsd' xmlns:lv='nativescript-telerik-ui/listview'>

    <lv:RadListView.listViewLayout>
        <lv:ListViewLinearLayout scrollDirection="Vertical"></lv:ListViewLinearLayout>
    </lv:RadListView.listViewLayout>

    <lv:RadListView.itemTemplate>
        <label text="{{ name }}"></label>
    </lv:RadListView.itemTemplate>

</lv:RadListView>

我希望能够使用test.component.ts.中的可变项来操作test.html中的RadListView然而,我所做的一切在这一刻都不起作用。有人能在一个例子中教我怎么做吗?

提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-21 14:27:32

1) .html文件中的语法不同于xml文件。

2) nativescript-telerik-ui在2.0.0-rc.1之前,所以他们目前正在研究它,您可以检查这个链接https://github.com/telerik/nativescript-ui-samples-angular/issues/1#issuecomment-225791969

3)如果您使用的是角的β维数,那么请检查这个链接http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/getting-started

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37839309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档