MeteorJS - 如何结合Add&编辑模板

时间:2015-06-18 06:57:07

标签: javascript meteor code-organization

我正在试图找出如何创建一个标准的CRUD应用程序,其中一个视图用于创建和编辑。目前我有:

                <WindowsFormsHost DockPanel.Dock="Top" Background="White">
                <rv:ReportViewer
                    x:Name="_ReportViewer"  
                    ReportRefresh="CreateStatement" 
                    BackColor="White"  
                    BorderStyle="None"
                    ></rv:ReportViewer>
            </WindowsFormsHost>

https://github.com/u843867/pilotlog5/tree/master/client/templates/flights

我想组合成一个Flight.html,以便创建和编辑使用相同的模板。只是不确定最好的方法。顺便说一下,我正在使用铁:路由器 感谢。

1 个答案:

答案 0 :(得分:1)

创建文件夹:

client/views/flight

然后将flightAdd.html,flightAdd.js,flightEdit.html和flight.js粘贴到此文件夹中。

另一种选择是:

client/views/flightAdd with flightAdd.html, flightAdd.js in the folder

client/views/flightEdit with flightEdit.html, flightEdit.js in the folder

但是关于如何构建应用程序没有正确和错误的答案。请查看此示例,获取有关如何构建应用的一些指导:https://github.com/DiscoverMeteor/Microscope