angular项目中使用ngSemantic

npm install ng-semantic --save
npm install jquery --save

下载 Official Semantic UI bundle ( .zip ) from Semantic-Org

将 semantic.min.csssemantic.min.jsjquery添加到angular-cli.json 如下:

...

"apps": [{
...
"styles": [
"styles.css",
"../path/to/semantic.min.css" //
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../path/to/semantic.min.js"
],
...
}]

就可以使用了

// Module
import { NgModule } from "@angular/core";
import { NgSemanticModule } from "ng-semantic"; @NgModule({
bootstrap: [ AppComponent ],
declarations: [ AppComponent ],
imports: [ BrowserModule, NgSemanticModule ]
})
export class AppModule {} // Component
import {Component} from '@angular/core'; @Component({
selector: 'demo-cmp',
template: `
<sm-segment class="raised">
Hello
</sm-segment>
`
})
export class DemoComponent {}
 
上一篇:JavaScript instanceof 运算符深入剖析【转载】


下一篇:Struts2+Spring3+MyBatis3整合以及Spring注解开发