查看“Angular2”的源代码
←
Angular2
跳转至:
导航
、
搜索
因为以下原因,你没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看并复制此页面的源代码:
=QuickStart= <source lang='text'> 0、安装npm。 1、新建项目文件夹angular2,放入4个初始文件。 package.jon tsconfig.json typings.json systemjs.config.js 2、安装包,项目文件夹下就会新增node_modules、typings文件夹。 npm install 3、在项目文件夹根下运用文件夹app,新增3个运用文件。 app.component.ts app.module.ts main.ts 4、在项目文件夹下新增2个文件。 index.html types.css 5、编辑、运行程序。使用Browsersync来动态刷新页面。 npm start </source> =Tutorial= ==The Hero Editor== Let’s take stock of what we’ve built. * Our Tour of Heroes uses the double curly braces of interpolation (a kind of one-way data binding) to display the application title and properties of a Hero object. * We wrote a multi-line template using ES2015’s template strings to make our template readable. * We can both display and change the hero’s name after adding a two-way data binding to the <input> element using the built-in ngModel directive. * The ngModel directive also propagates changes to every other binding of the hero.name. ==Master/Detail== Here’s what we achieved in this chapter: * Our Tour of Heroes now displays a list of selectable heroes * We added the ability to select a hero and show the hero’s details * We learned how to use the built-in directives ngIf and ngFor in a component’s template ==Multiple Components== Let’s take stock of what we’ve built. * We created a reusable component * We learned how to make a component accept input * We learned to declare the application directives we need in an Angular module. We list the directives in the NgModule * decorator's declarations array. * We learned to bind a parent component to a child component.
返回
Angular2
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息