似乎AngularJS在处理HTML模板第一行中的注释时遇到了问题。
控制台给出了以下错误:
Error: [$compile:tplrt] http://errors.angularjs.org/1.3.15/$compile/tplrt?p0=deviceItem&p1=deviceItem.html
at Error (native)
at https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.min.js:6:417
at https://cdnjs.cloudflare.com
当我使用angular的指令时,我得到了这个错误。
Error: [$compile:tplrt] Template for directive 'header' must have exactly one root element. /apps/dhe.techForm/views/directives/header.html
http://errors.angularjs.org/1.4.8/$compile/tplrt?p0=header&p1=%2Fapps%2Fdhe.techForm%2Fviews%2Fdirectives%2Fheader.h
你好,我正在写两个单元测试。对于第二个问题,我尝试了下面的代码,但是我得到了以下错误错误::期望一个间谍,但得到函数.
我找到了在组件中编写的监视方法的解决方案,但是我找不到如何测试这个setTitle()方法!有什么想法吗?
My FirstComponent
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
@Component({
selector: 'app-mission',