12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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
- };
- }
- }])
|