app.controller('DashCtrl', ["$rootScope", "$scope", function($rootScope, $scope) { console.log('ocLazy is load DashCtrl'); console.log('aaaaaaaa'); var vm = this; // funcation assignment vm.onSubmit = onSubmit; // variable assignment vm.issueNumber = ''; // <-- fill this in; vm.env = getEnv(); vm.model = {}; vm.options = { formState: {} }; vm.fields = getFields(); vm.originalFields = angular.copy(vm.fields); // vm.issueLink = 'https://github.com/formly-js/angular-formly/issues/' + vm.issueNumber; // function definition function getFields() { // return your fields here return [{ key: 'firstInput', type: 'input', templateOptions: { label: 'Input', placeholder: 'Formly is terrific!' }, expressionProperties: { 'templateOptions.label': 'model[options.key] || "Input"' } }, { key: 'text', type: 'checkbox', templateOptions: { label: 'Hidden box' }, hideExpression: '!model.firstInput' } ]; } function onSubmit() { vm.options.updateInitialValue(); alert(JSON.stringify(vm.model), null, 2); } function getEnv() { return { angularVersion: angular.version.full, // formlyVersion: formlyVersion }; } }])