从“ @ angular / core”导入{Component,ViewEncapsulation};错误

时间:2018-10-16 03:53:10

标签: angular

我使用vs代码启动项目代码:

import java.util.*;
import java.util.stream.*;
import java.util.function.*;

class Author {

    private String name;
    private int bookCount;

    public Author() {
    }

    public Author(String name, int bookCount) {
        this.name = name;
        this.bookCount = bookCount;
    }

    public String getName() {
        return name;
    }

    public int getBookCount() {
        return bookCount;
    }
}

class Book {

    private String name;
    private int year;
    private Author author;

    public Book(String name, int year, Author author) {
        this.name = name;
        this.year = year;
        this.author = author;
    }

    public String getName() {
        return name;
    }

    public int getYear() {
        return year;
    }

    public Author getAuthor() {
        return author;
    }

    @Override
    public String toString() {
        return "(" + name + ", " + year + " - " + author.getName() + ")";
    }

}

public class TestingLambdas2 {

    public static void main(String [] args) {

        Author hgWells = new Author("H. G. Wells", 2);
        Author hLee = new Author("Harper Lee", 1);

        Book book1 = new Book("War of the Worlds", 1898, hgWells);
        Book book2 = new Book("The Time Machine", 1895, hgWells);
        Book book3 = new Book("To Kill a Mockingbird", 1960, hLee);

        List<Book> books = Arrays.asList(book1, book2, book3);
        System.out.println("> All books:" + books);

        Predicate<Book> yearFilter = book -> book.getYear() > 1899;
        System.out.println("> Filtered book author(s):");
        books.stream()
                .filter(yearFilter)
                .map(book -> book.getAuthor().getName())
                .forEach(authorName -> System.out.println(authorName));
    }
}
import {Component, OnInit, ViewEncapsulation ,AfterViewInit} from '@angular/core'
import { Helpers } from '../../../helpers'

declare let mLayout: any
@Component({
    selector: "app-breadcrumb",
    templateUrl: "./breadcrumb.component.html",
    encapsulation: ViewEncapsulation.None,
})
export class BreadcrumbComponent implements OnInit, AfterViewInit {
    constructor() {

    }
    ngOnInit() {

    }
    ngAfterViewInit() {

    }
}

  

侦听器侦听   ws://127.0.0.1:14841 / d3b75433-e088-44a2-b228-51a9183448d4   请参阅:附加了https://nodejs.org/en/docs/inspector调试器。   /Users/haiming_yu/IdeaProjects/deal-albedo/albedo-boot-ui-angular/target/www/app/app/theme/layouts/breadcrumb/breadcrumb.component.js:10   从'@ angular / core'导入{Component,ViewEncapsulation};

code 我不知道该怎么办。请帮助我。

1 个答案:

答案 0 :(得分:1)

您是否尝试过npm安装?