{"action":"created","issue":{"url":"https://api.github.com/repos/formly-js/ng-formly/issues/472","repository_url":"https://api.github.com/repos/formly-js/ng-formly","labels_url":"https://api.github.com/repos/formly-js/ng-formly/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/formly-js/ng-formly/issues/472/comments","events_url":"https://api.github.com/repos/formly-js/ng-formly/issues/472/events","html_url":"https://github.com/formly-js/ng-formly/issues/472","id":239134217,"number":472,"title":"Load JSON with http service","user":{"login":"bhupendrasolanki251185","id":19591366,"avatar_url":"https://avatars0.githubusercontent.com/u/19591366?v=3","gravatar_id":"","url":"https://api.github.com/users/bhupendrasolanki251185","html_url":"https://github.com/bhupendrasolanki251185","followers_url":"https://api.github.com/users/bhupendrasolanki251185/followers","following_url":"https://api.github.com/users/bhupendrasolanki251185/following{/other_user}","gists_url":"https://api.github.com/users/bhupendrasolanki251185/gists{/gist_id}","starred_url":"https://api.github.com/users/bhupendrasolanki251185/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhupendrasolanki251185/subscriptions","organizations_url":"https://api.github.com/users/bhupendrasolanki251185/orgs","repos_url":"https://api.github.com/users/bhupendrasolanki251185/repos","events_url":"https://api.github.com/users/bhupendrasolanki251185/events{/privacy}","received_events_url":"https://api.github.com/users/bhupendrasolanki251185/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-28T11:30:41Z","updated_at":"2017-06-29T07:09:18Z","closed_at":null,"body":"I have create JSON file and put the valid json structure as per fomly, and load with http service but it is not working, but if i put that same json in component then it is working fine\r\n\r\nJSON file \r\n[\r\n    {\r\n        \"fieldGroupClassName\": \"row\",\r\n        \"fieldGroup\": [\r\n            {\r\n                \"key\": \"firstName\",\r\n                \"type\": \"input\",\r\n                \"className\": \"col-md-6\",\r\n                \"templateOptions\": {\r\n                    \"type\": \"text\",\r\n                    \"label\": \"First Name\",\r\n                    \"id\": \"txtFname\",\r\n                    \"tabindex\": \"1\"\r\n                },\r\n                \"validators\": {\r\n                    \"validation\": \"Validators.compose([Validators.required, Validators.maxLength(10), Validators.minLength(2)])\"\r\n                },\r\n                \"validation\": {\r\n                    \"show\": true,\r\n                    \"messages\": {\r\n                        \"className\": \"\",\r\n                        \"required\": \"First name is required\",\r\n                        \"minlength\": \"First name must be atleast 2 character long.\",\r\n                        \"maxlength\": \"First name cannot be more than 10 character long.\"\r\n                    }\r\n                }\r\n            }\r\n        ]\r\n    }\r\n]\r\n\r\nDiffrence between component and JSON file structure is\r\nIn JSON file i have to provide double quotes [\" \"] to create valid json and in component i have not provide any double quotes [\" \"]"},"comment":{"url":"https://api.github.com/repos/formly-js/ng-formly/issues/comments/311881775","html_url":"https://github.com/formly-js/ng-formly/issues/472#issuecomment-311881775","issue_url":"https://api.github.com/repos/formly-js/ng-formly/issues/472","id":311881775,"user":{"login":"franzeal","id":7455769,"avatar_url":"https://avatars0.githubusercontent.com/u/7455769?v=3","gravatar_id":"","url":"https://api.github.com/users/franzeal","html_url":"https://github.com/franzeal","followers_url":"https://api.github.com/users/franzeal/followers","following_url":"https://api.github.com/users/franzeal/following{/other_user}","gists_url":"https://api.github.com/users/franzeal/gists{/gist_id}","starred_url":"https://api.github.com/users/franzeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franzeal/subscriptions","organizations_url":"https://api.github.com/users/franzeal/orgs","repos_url":"https://api.github.com/users/franzeal/repos","events_url":"https://api.github.com/users/franzeal/events{/privacy}","received_events_url":"https://api.github.com/users/franzeal/received_events","type":"User","site_admin":false},"created_at":"2017-06-29T07:09:18Z","updated_at":"2017-06-29T07:09:18Z","body":"You can't reference a validator as a string without defining it in the formly config.  Please refer to the [demo](https://github.com/formly-js/ng-formly/blob/master/demo/src/formly/index.ts#L24)."}}
{"actor":{"display_login":"franzeal"}}