opened
RogerHuangZB
username_0
<!--
1. 官方 issue 用于报告 bug 和需求建议，关于Angular的使用和开发问题在这里可能不会得到解答，感谢您的理解。
2. 建议使用英文进行提问，这样你的问题可以被更多的人阅读和回答。如果表达上确实较复杂，英文标题加中文描述也是可选的方案。
3. 报告 BUG 时请务必按照下列格式书写，并尽可能提供源代码、复现步骤、复现演示、GIF 演示等。我们和你一样都希望尽快解决问题，请不要浪费时间在互相追问上。
4. 注意你的 issue 格式，不适合阅读的格式会被忽视或直接关闭。
5. 如果需要粘贴源码，尽量避免截图并注意代码格式。关于如何在 Markdown 中书写代码可以参考：https://segmentfault.com/markdown
6. 抱怨不能解决问题，通畅有效和心情舒畅的交流才能解决。
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[x] Documentation issue or request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Support request => Please do not submit support request here
</code></pre>

## Current behavior
<pre><code>
Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'nz-switch'.
1. If 'nz-switch' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.
2. If 'nz-switch' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<div class="menu-bar">
  <nz-switch [ERROR ->][(ngModel)]="theme">
    <span checked>Dark</span>
    <span unchecked>Light</span>
"): ng:///PagesModule/BaMenuBarComponent.html@15:13
</code></pre>

pages.module.ts
<pre><code>
@NgModule({
  imports: [
    CommonModule,
    routing,
    NgZorroAntdModule
  ],...
</code></pre>

ba-menu-bar.component.html
just copy from api document : [https://ng.ant.design/#/components/menu](url)
`  <nz-switch [(ngModel)]="theme">`
`    <span checked>Dark</span>`
`    <span unchecked>Light</span>`
`  </nz-switch>`
`  <br>`
`  <br>`

<pre><code>
export class BaMenuBarComponent implements OnInit {
  theme = true;
</code></pre>
## Expected behavior
<!-- Describe what the desired behavior would be. -->


## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* 
-->

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->


## Environment

<pre><code>
Angular version: 4.2.4
<!-- Check whether this is still an issue in the most recent Angular version -->
ng-zorro-antd version: 0.5.0-rc.4
<!-- Check whether this is still an issue in the most recent ng-zorro-antd version -->
Browser:
- [x] Chrome (desktop) version 59.0.3071.86
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
 
For Tooling issues:
- Node version: v8.1.0  <!-- run `node --version` -->
- Platform: Windows 10  <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>
Can't bind to 'ngModel' since it isn't a known property of 'nz-switch'
issue
created
SangKa
username_1
need to import `FormsModule`
comment
closed
vthinkxie
username_2
issue