1+ < html >
2+ < body >
3+ < style type ="text/css ">
4+ .template {display : none}
5+ .card {
6+ border : 1px solid blue;
7+ padding-left : 20px ;
8+ }
9+ </ style >
10+
11+ < div data-template_id ="abc1 " data-fetch_collection ="render_test ">
12+
13+ < div class ="template card {{render2.collection}} card margin:10px firstname "
14+ data-value ="{{render2.data._id}} "
15+ data-template_id ="abc1 "
16+ data-render_array ="render2.data ">
17+
18+ < div class ="card-body padding:15px " data-collection ="{{render2.collection}} ">
19+ < h3 class ="{{render2.data.firstname}} blue " value ="{{render2.data.lastname}} - {{render2.data.firstname}} "> --</ h3 >
20+ < h3 data-value ="{{ render2.data.lastname }} " value ="{{lastname}} "> </ h3 >
21+ < input value ="{{ render2.collection }} "/>
22+ < h3 class ="email " value ="{{render2.data.email}} "> --</ h3 >
23+ < textarea value ="{{render2.data.lastname}} "> </ textarea >
24+ < h3 data-attribute ="{{render2.data.personal_info.email}} " name ="email " value ="{{render2.data.personal_info.email}} "> </ h3 >
25+
26+ < div class ="template card "
27+ data-render_array ="render2.data.testing_array ">
28+
29+ < h3 data-attribute ="{{render2.data.testing_array.email}} " name ="email " class ="{{render2.data.testing_array.email}} " value ="{{render2.data.testing_array.email}} "> </ h3 >
30+ < h3 value ="{{render2.collection}} "> </ h3 >
31+
32+ < h3 value ="{{render2.data.personal_info.email}} "> </ h3 >
33+ </ div >
34+ </ div >
35+ </ div >
36+
37+ </ div >
38+
39+
40+ < pre >
41+ < h1 > Paste in your browser console</ h1 >
42+
43+
44+
45+ /** Example of array object from db -- render2 is an example of data-render_id**/
46+ CoCreateRender.render('[data-template_id=abc1]',{
47+ render2: {
48+ collection : 'dededede',
49+ data: [{
50+ _id : '123kijfhgfkel45',
51+ firstname : 'Jin',
52+ lastname : 'codingmachinine',
53+ personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
54+ email: 'tesing@gamil.com',
55+ testing_array : [
56+ {email:'jeanmendozar@gmail.com','phone':'0','home':'home1'},
57+ {email:'frank@gmail.com','phone':'1','home':'home2'},
58+ {email:'jose@gmail.com','phone':'2','home':'home3'},
59+ {email:'juan@gmail.com','phone':'3','home':'home4'},
60+ {email:'kooo@gmail.com','phone':'4','home':'home5'},
61+ {email:'allask@gmail.com','phone':'5','home':'home6'},
62+ {email:'ana@gmail.com','phone':'6','home':'home7'},
63+ {email:'rosa@gmail.com','phone':'7','home':'home8'},
64+ {email:'nuevo@gmail.com','phone':'8','home':'home9'}
65+ ],
66+ },{
67+ _id : '5678efe32qd2ol',
68+ firstname : 'jean',
69+ lastname : 'Mendoza',
70+ personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
71+ email: 'tesing2@gamil.com',
72+ testing_array : [
73+ {email:'1jeanmendozar@gmail.com','phone':'10','home':'home11'},
74+ {email:'1frank@gmail.com','phone':'11','home':'home12'},
75+ {email:'1jose@gmail.com','phone':'12','home':'home13'},
76+ {email:'1juan@gmail.com','phone':'13','home':'home14'},
77+ {email:'1kooo@gmail.com','phone':'14','home':'home15'},
78+ {email:'1allask@gmail.com','phone':'15','home':'home16'},
79+ {email:'1ana@gmail.com','phone':'16','home':'home17'},
80+ {email:'1rosa@gmail.com','phone':'17','home':'home18'},
81+ {email:'1nuevo@gmail.com','phone':'18','home':'home19'}
82+ ],
83+ },
84+ ]
85+ }
86+ })
87+
88+ </ pre >
89+ < script >
90+ var config = {
91+ apiKey : 'c2b08663-06e3-440c-ef6f-13978b42883a' ,
92+ securityKey : 'f26baf68-e3a9-45fc-effe-502e47116265' ,
93+ organization_Id : '5de0387b12e200ea63204d6c'
94+ }
95+ </ script >
96+ </ body >
97+ <!--<script src="../src/CoCreate-response.js"></script>-->
98+ < script src ="../src/CoCreate-render.js "> </ script >
99+ <!--<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>-->
100+ </ html >
0 commit comments