TheNativeScriptprojectbutyoucanuseAngularCLItogeneratecomponent.
Usagegitclonehttps://github.com/wellwind/native-script-with-ng-cli.gitcdnative-script-with-ng-clinpminstallnpmrunstart.androidnpmrunstart.iosYouwillseeaverysimpleNativeScriptapp.
UsingAngularCLItogeneratecomponentnggctestThecommandwillgenerateacomponentinsrc\app\test.YouhavetouseNativeScriptUIon*.htmlfile.
NativeScriptuseabsoluteviewpathfortemplateUrlin@Component,toenablerelativepath,youhavetoaddmoduleId:module.idto@Component()decorator.
@Component({moduleId:module.id,selector:"app-test",templateUrl:"./test.component.html"})exportclassTestComponentimplementsOnInit{}
评论