fredrik
fredrik

Reputation: 6638

TS Compile fails silently

I've included ng2-semantic-ui in my package.json, version ^0.2.3, and originally I had a component that looked like this:

import {Component} from '@angular/core';
import {Title} from '@angular/platform-browser';

import {HomeTreeComponent} from './tree';
import {UserPhotoComponent} from "./userphoto.component";

@Component({
    templateUrl: 'app/home/index.html',
    providers: [Title],
    directives: [HomeTreeComponent, UserPhotoComponent]
})
export class HomeIndexComponent {
    constructor(title: Title) {
        title.setTitle('Welcome');
    }
}

Which compiles nicely and gives a javascript file as expected. But as soon as I add import {TAB_DIRECTIVES} from "ng2-semantic-ui/ng2-semantic-ui"; to the imports and TAB_DIRECTIVES to the directives things go wrong. But, I'm not getting any compilation errors from tsc - in fact the errorlevel (running node on windows) is 0 and it prints neither errors or warnings, and all other TS files are compiled properly.

Other files are compiled properly, just not this file. Have I overlooked something? I have added an appropriate map in the systemjs config to load it, but I don't think that comes into play until and unless it loads in a browser.

Upvotes: 1

Views: 673

Answers (1)

pd farhad
pd farhad

Reputation: 6432

I used semantic-ui in my non angular-cli project by keeping the semantic.min.css under resource folder. I dont need to configure any package.json or system.config.js. And show the path in the index.html. Here goes a screenshot

enter image description here

Now in my component where I need to use semantic-ui, I code like this

@Component({
  selector: 'app-semantic',

  template: `
     <div class="ui tab" data-tab="first">
          My First Tab
     </div>
     <div class="ui tab" data-tab="other">
           Other content
     </div>
  `
})

angular version of my project is 2.0.0-rc.1

Upvotes: 0

Related Questions