Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): Removed the need for control service
Control service needs to be updated every time new formly template is added. Also Instead of keeping angular form control creation logic at central place may not be good idea. it can be responsiblity of formly input directives. This will also help in keeping formly and template separate issue #15 Breaking changed 1. control service is removed. 2. Control groups are only created only once during ngInit
- Loading branch information
1 parent
3c353cf
commit 09f9778
Showing
19 changed files
with
226 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,69 @@ | ||
var gulp = require('gulp'); | ||
var livereload = require('gulp-livereload'); | ||
|
||
var PATHS = { | ||
src: 'src/**/*.ts', | ||
demo: 'demo/**/*.ts' | ||
src: 'src/**/*.ts', | ||
demo: 'demo/**/*.ts' | ||
}; | ||
|
||
gulp.task('clean', function (done) { | ||
var del = require('del'); | ||
del(['dist'], done); | ||
var del = require('del'); | ||
del(['dist'], done); | ||
}); | ||
|
||
gulp.task('ts2js', function () { | ||
var typescript = require('gulp-typescript'); | ||
var tscConfig = require('./tsconfig.json'); | ||
var typescript = require('gulp-typescript'); | ||
var tscConfig = require('./tsconfig.json'); | ||
|
||
gulp.src([PATHS.src, 'node_modules/angular2/typings/browser.d.ts', PATHS.demo]) | ||
.pipe(typescript(tscConfig.compilerOptions)) | ||
.js.pipe(gulp.dest('src')); | ||
gulp.src([PATHS.src, 'node_modules/angular2/typings/browser.d.ts', PATHS.demo]) | ||
.pipe(typescript(tscConfig.compilerOptions)) | ||
.js.pipe(gulp.dest('src')) | ||
.pipe(livereload()); | ||
}); | ||
|
||
gulp.task('test', function (done) { | ||
var karmaServer = require('karma').Server; | ||
new karmaServer({ | ||
configFile: __dirname + '/karma.conf.js', | ||
singleRun: true | ||
}, done).start(); | ||
var karmaServer = require('karma').Server; | ||
new karmaServer({ | ||
configFile: __dirname + '/karma.conf.js', | ||
singleRun: true | ||
}, done).start(); | ||
}); | ||
|
||
gulp.task('tdd', function (done) { | ||
var karmaServer = require('karma').Server; | ||
new karmaServer({ | ||
configFile: __dirname + '/karma.conf.js' | ||
}, done).start(); | ||
var karmaServer = require('karma').Server; | ||
new karmaServer({ | ||
configFile: __dirname + '/karma.conf.js' | ||
}, done).start(); | ||
}); | ||
|
||
gulp.task("tslint", function() { | ||
var tslint = require("gulp-tslint"); | ||
var tslint = require("gulp-tslint"); | ||
|
||
gulp.src(PATHS.src) | ||
.pipe(tslint()) | ||
.pipe(tslint.report("verbose")) | ||
gulp.src(PATHS.src) | ||
.pipe(tslint()) | ||
.pipe(tslint.report("verbose")) | ||
|
||
gulp.src(PATHS.demo) | ||
.pipe(tslint()) | ||
.pipe(tslint.report("verbose")) | ||
gulp.src(PATHS.demo) | ||
.pipe(tslint()) | ||
.pipe(tslint.report("verbose")) | ||
}); | ||
|
||
gulp.task('play', ['ts2js'], function () { | ||
var http = require('http'); | ||
var connect = require('connect'); | ||
var serveStatic = require('serve-static'); | ||
var open = require('open'); | ||
var http = require('http'); | ||
var connect = require('connect'); | ||
var serveStatic = require('serve-static'); | ||
var open = require('open'); | ||
|
||
var port = 9000, app; | ||
var port = 9000, app; | ||
|
||
gulp.watch(PATHS.src, ['ts2js']); | ||
livereload.listen({quiet: true}); | ||
|
||
app = connect().use(serveStatic(__dirname)); | ||
http.createServer(app).listen(port, function () { | ||
open('http://localhost:' + port + '/demo'); | ||
}); | ||
gulp.watch(PATHS.src, ['ts2js']); | ||
|
||
app = connect().use(serveStatic(__dirname)); | ||
http.createServer(app).listen(port, function () { | ||
open('http://localhost:' + port + '/demo'); | ||
}); | ||
}); | ||
|
||
gulp.task('default', ['play']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
export interface FormlyFieldConfig { | ||
key?: string; | ||
templateOptions?: FormlyTemplateOptions; | ||
validation?: any; | ||
template?: string; | ||
fieldGroup?: Array<FormlyFieldConfig>; | ||
hideExpression?: boolean | string | (() => boolean); | ||
className?: string; | ||
type?: string; | ||
expressionProperties?: any; | ||
focus?: boolean; | ||
} | ||
|
||
export interface FormlyTemplateOptions { | ||
type?: string; | ||
label?: string; | ||
placeholder?: string; | ||
disabled?: Boolean; | ||
options?: Array<any>; | ||
rows?: number; | ||
cols?: number; | ||
description?: string; | ||
focus?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.