I want to create some kind of template with angularjs that uses custom directives and then according to the attributes of these directives it creates input fields, for example if you have this directive in the template :
<cms:input type='text' size='14' default='this is a text' label='Content Header' ></cms:input>
<cms:input type='textarea' size='50' default='this is a text area' label='Content Paragraph' ></cms:input>
and this is the code of the directive
app.directive('cmsInput', function() {
return {
restrict: 'E',
require: '^ngModel',
scope: {
default: '@default',
name: '@name',
size: '@size',
type: '@type'
},
});
i want in the main page to do a ngInclude to the template and then show the fields according to the attributes of the directive for example for the directives above it should shows : a text field with the default text this is a text and a label with the text 'Content Header' and a textfield with the attributes accordingly
So to make the things basic i will tell what i want without technical terms : so what i want to do is create different html pages that contains this directives to use them as templates for example 'mainPage.html', 'header.html', and these templates contains a whole page with placeholders for the texts, the placeholders should be this directives.
And then in another page you should specify which template to use, and according to the placeholders in the template it should create input fields dynamically