Skip to content

frankpepermans/ng2_form_components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng2_form_components

Build Status


html-text-transform-component

An Angular2 component to edit HTML tags.

Usage

A simple usage example:

import 'package:angular2/bootstrap.dart';
import 'package:angular/angular.dart';

import 'package:ng2_form_components/ng2_form_components.dart';

main() {
  bootstrap(AppComponent);
}

@Component(
    selector: 'my-app',
    template: '''<html-text-transform-component [buttons]="buttons" [model]="model" (transformation)="notifyUpdate(\$event)"></html-text-transform-component>''',
    changeDetection: ChangeDetectionStrategy.OnPush,
    directives: const [HTMLTextTransformComponent]
)
class AppComponent {

  final String model = 'Lorem&nbsp;ipsum dolor si amet...';

  final List<List<HTMLTextTransformation>> buttons = <List<HTMLTextTransformation>>[
    <HTMLTextTransformation>[
      new HTMLTextTransformation('b', 'B'),
      new HTMLTextTransformation('i', 'I'),
      new HTMLTextTransformation('u', 'U'),
      new HTMLTextTransformation('span', 'A', style: <String, String>{
        'float': 'right'
      })
    ],
    <HTMLTextTransformation>[
      new HTMLTextTransformation('li', 'LI')
    ]
  ];

  AppComponent();

  int updateCount = 0;

  void notifyUpdate(String newModel) {
    print('updated:(${++updateCount}): $newModel');
  }
}

About

Dart ng2 components

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published