所有指南都建议安装npm,但我正在寻找一种没有它的方法.
有Angular2文件可用,但它们都不是TypeScript代码.
那我该怎么办?我需要Angular2.ts或具体Angular2-xx.js和.d.ts文件?
更新:我已经下载Angular2过NPM,并得到完整的源代码树,其中很难找到具体的东西.搜索.d.ts对于Angular2没有返回结果.很多.ts和.d.ts文件都在庞大的代码集合中.
首先,请让我明白我是一个Windows用户,对网络世界来说是一个新手.在过去的几个月里,我一直在学习python和django,对我来说这是一次很棒的经历.现在我以某种方式创建了一个我希望在生产服务器中部署的小项目.由于django有内置的开发服务器,所以对我没有问题.但现在我必须将它部署到生产服务器上,我用Google搜索并发现Nginx + uWSGI或Nginx + Gunicorn是它的最佳选择.由于uWSGI和Gunicord与Windows不兼容,我认为我应该适应Ubuntu或其他Unix系统.
所以我的问题是:
非常感谢你的时间,如果我的问题是一个蹩脚的问题,请原谅.希望得到积极回应的答案.
我正在尝试学习Angular 2,所以我做了一些hello world例子.这是我的代码:
boot.ts
import {bootstrap} from 'angular2/platform/browser'
import {AppComponent} from './app.component'
import {DataService} from './app.dataservice'
bootstrap(AppComponent, [DataService]);
Run Code Online (Sandbox Code Playgroud)
的index.html
...
<body>
<hello-world>Loading...</hello-world>
<hello-world>Loading...</hello-world>
</body>
...
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import {Component} from 'angular2/core';
import {DataService} from './app.dataservice'
@Component({
selector: 'hello-world',
template: '<h1>Hello {{ item }}</h1>'
})
export class AppComponent {
items: Array<number>;
item: number;
constructor(dataService: DataService) {
this.items = dataService.getItems();
this.item = this.items[0];
}
}
Run Code Online (Sandbox Code Playgroud)
app.dataservice.ts
export class DataService {
items: Array<number>;
constructor() {
this.items = [1,2,3];
}
getItems() {
return …Run Code Online (Sandbox Code Playgroud) 我目前正在将PhoneGap用于我正在开发的移动应用程序.在我的登录屏幕中,当我选择文本字段时,当键盘向上滑动时,视图会水平缩小.这只发生在Android而不是iOS上.
这让我很担心,因为我有一个底部工具栏,position:absolute; bottom:0;当键盘出现时,这个工具栏会在Android中向上推.在iOS中,键盘只是简单地覆盖它.
我正在寻找一种方法来获得仅使用其内容呈现的组件.例如,给定组件:
@Component({selector: 'my-cmp', template: '<div> my-cmp </div>'})
class MyComponent {
}
Run Code Online (Sandbox Code Playgroud)
使用angular2渲染它会将以下内容添加到DOM:
<my-cmp>
<div> my-cmp </div>
</my-cmp>
Run Code Online (Sandbox Code Playgroud)
虽然我想找到一种方法直接渲染它:
<div> my-cmp </div>
Run Code Online (Sandbox Code Playgroud)
可悲的是,因为角度2相对较新(只是测试版) - 谷歌没有那么有用,更不用说当前的文档是多么缺乏..
我在.NET,Silverlight工作了几年,现在我开始使用Angular 2和Expressjs.我有一个疑问,即使我找不到如何在角2 + Expressjs中这样做,并且从客户端安全?
<% if(User.Identity.IsAuthenticated){ %>
<b>Sign Out</b>
<% } else { %>
<b>Sign In</b>
<% } %>
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用多个域的CMS,我必须在我的页面中只使用一个谷歌地图脚本.
有没有办法在没有API密钥的情况下使用谷歌地图?
否则,它不起作用?
我正在尝试在最终版本2.0.0中动态加载组件.
使用RC5我使用以下代码加载:
创建一个指令来加载控件:
import {
CheckboxComponent, CheckboxListComponent,DatePickerComponent
} from '../components/';
@Directive({
selector: '[ctrl-factory]'
})
export class ControlFactoryDirective implements OnChanges {
@Input() model: any;
constructor(private vcRef: ViewContainerRef, private resolver: ComponentResolver) {
}
create(cp) {
this.resolver.resolveComponent(cp)
.then(factory => {
const injector = ReflectiveInjector.fromResolvedProviders([], this.vcRef.parentInjector);
this.vcRef.createComponent(factory, 0, injector, []);
let ch = this.vcRef.createComponent(factory, 0, injector, []).instance;
ch.model = this.model;
});
}
ngOnChanges() {
if (!this.model) return;
switch (this.model.type) {
case 'checkbox':
this.create(CheckboxComponent);
break;
case 'checkboxlist':
this.create(CheckboxListComponent);
break;
case 'datepicker':
this.create(DatePickerComponent);
break;
default:
break; …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Erlang系统并且重复出现的问题是记录是编译时预处理器宏(差不多),并且它们无法在运行时进行操作...基本上,我正在使用属性模式,其中属性在运行时添加到前端(AS3)上的对象.理想情况下,我会在Erlang方面用一个列表来反映这一点,因为它是一个基本的数据类型,但是在QCL [查询ETS表]中使用记录是不可能的,因为使用它们我必须具体说出哪个记录属性我想查询...我在larges表中至少有15列,所以在一个巨大的switch语句中列出它们(案例X)只是简单的丑陋.
有没有人有任何想法如何优雅地解决这个问题?也许一些内置函数用于创建具有适当签名的元组以用于模式匹配(用于QLC)?
谢谢
我正在开发一个需要用指南针旋转mapView的应用程序.我知道如何旋转相机,但我需要用指南针旋转mapView.中心点应该是当前位置.我找到了地图V1的代码,但我需要使用Maps V2
android google-maps google-maps-api-2 google-maps-android-api-2 android-maps-v2
angular ×5
javascript ×4
typescript ×3
android ×2
google-maps ×2
api ×1
asp.net ×1
conditional ×1
cordova ×1
django ×1
erlang ×1
express ×1
gunicorn ×1
key ×1
keyboard ×1
npm ×1
runtime ×1
uwsgi ×1