angular - Use semantic-ui behaviors in angular2 -


i'm going use semantic-ui behaviors on angular2 components.

i tried integrations ng2-semantic-ui unfortunately, doesn't support "visibility behaviors" @ moment , should implement manually, know can't use <script> tag on angular templates, can't call semantic-ui functions manually.

have suggestion solve problem?

simply include semantic-ui in index.html file (this make modules working templates ) :

ps: <script> tag works in index.html file.

    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.11/semantic.min.js"></script> <!--or -->     <script src="relaive_path_to/semantic.min.js"></script> 

in your.component.ts file add this:declare var $: any; next importing section , initialize visibility behavior) in ngafterviewinit(){} following :

[demo] (re-run see lazy loading images visibility behavior)

component.ts

import {component,oninit} 'angular2/core'; declare var $: any; @component({     selector: 'my-app',     templateurl: 'demo.html', }) export class appcomponent implements oninit {       ngafterviewinit(){  $('.demo.items .image img')   .visibility({     type       : 'image',     transition : 'fade in',     duration   : 1000   }) ;     } } 

if want use specific module see way import small parts of semantic-ui.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -