第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Angular2異常:由于它不是已知的本機屬性,因此無法綁定到“ routerLink”

Angular2異常:由于它不是已知的本機屬性,因此無法綁定到“ routerLink”

鴻蒙傳說 2019-11-27 12:52:45
顯然,Angular2的beta版比新的要新,因此那里沒有太多的信息,但是我正在嘗試做一些我認為比較基本的路由。從https://angular.io網(wǎng)站竊取快速入門代碼和其他代碼片段導(dǎo)致了以下文件結(jié)構(gòu):angular-testapp/    app/        app.component.ts        boot.ts        routing-test.component.ts    index.html文件填充如下:index.html<html>  <head>    <base href="/">    <title>Angular 2 QuickStart</title>    <link href="../css/bootstrap.css" rel="stylesheet">    <!-- 1. Load libraries -->    <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>    <script src="node_modules/systemjs/dist/system.src.js"></script>    <script src="node_modules/rxjs/bundles/Rx.js"></script>    <script src="node_modules/angular2/bundles/angular2.dev.js"></script>    <script src="node_modules/angular2/bundles/router.dev.js"></script>    <!-- 2. Configure SystemJS -->    <script>      System.config({        packages: {                  app: {            format: 'register',            defaultExtension: 'js'          }        }      });      System.import('app/boot')            .then(null, console.error.bind(console));    </script>  </head>  <!-- 3. Display the application -->  <body>    <my-app>Loading...</my-app>  </body></html>引導(dǎo)程序import {bootstrap}    from 'angular2/platform/browser'import {ROUTER_PROVIDERS} from 'angular2/router';import {AppComponent} from './app.component'bootstrap(AppComponent, [    ROUTER_PROVIDERS]);app.component.tsimport {Component} from 'angular2/core';import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, LocationStrategy, HashLocationStrategy} from 'angular2/router';import {RoutingTestComponent} from './routing-test.component';@Component({    selector: 'my-app',    template: `        <h1>Component Router</h1>        <a [routerLink]="['RoutingTest']">Routing Test</a>        <router-outlet></router-outlet>        `})我在這里發(fā)現(xiàn)了一個模糊的相關(guān)問題;升級到angular2.0.0-beta.0后,router-link指令中斷。但是,答案之一中的“有效示例”是基于beta版的代碼-可能仍然可以使用,但是我想知道為什么我創(chuàng)建的代碼不起作用。
查看完整描述

3 回答

?
HUH函數(shù)

TA貢獻1836條經(jīng)驗 獲得超4個贊

使用Visual Studio進行編碼時的警告語(2013)


我已經(jīng)浪費了4至5個小時來嘗試調(diào)試此錯誤。我嘗試通過字母找到在stackoverflow上找到的所有解決方案,但仍然出現(xiàn)此錯誤:Can't bind to 'routerlink' since it isn't a known native property


請注意,在復(fù)制/粘貼代碼時,Visual Studio有自動格式化文本的討厭習(xí)慣。我總是從VS13得到一個小的瞬時調(diào)整(駱駝的情況消失了)。


這個:


<div>

    <a [routerLink]="['/catalog']">Catalog</a>

    <a [routerLink]="['/summary']">Summary</a>

</div>

成為:


<div>

    <a [routerlink]="['/catalog']">Catalog</a>

    <a [routerlink]="['/summary']">Summary</a>

</div>

差異很小,但足以觸發(fā)錯誤。最丑陋的部分是,每次我復(fù)制粘貼時,這種微小的差異一直在避免我的注意。碰巧的機會,我看到了這個微小的區(qū)別并解決了。


查看完整回答
反對 回復(fù) 2019-11-27
  • 3 回答
  • 0 關(guān)注
  • 799 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號