Umbraco 7 バックエンド用の新しいカスタム セクションを作成しました。これで、コードを使用して edit.html ファイル プロパティ エディターの目的を作成しました。
<script type="text/javascript">
function CustomSectionEditController($scope, $log, $routeParams) {
$scope.content = { tabs: [{ id: 1, label: "Tab 1" }, { id: 2, label: "Tab 2" }] };
$scope.EditMode = function () {
$log.warn($routeParams);
return $routeParams.create == 'true';
};
}
</script>
<div ng-controller="CustomSectionEditController">
<umb-panel>
<umb-header tabs="content.tabs">
<div class="umb-headline-editor-wrapper span12 ng-scope">
<h1 class="ng-binding">My custom section {{id}}</h1>
</div>
</umb-header>
<umb-tab-view>
<umb-tab id="tab1" rel="svensson">
<div class="umb-pane">
This is tab content for tab 1<br />
<p ng-show="EditMode()">
<span class="label label-warning">In create mode, this label is only showed when the controller sees the create-querystring item.</span>
</p>
</div>
</umb-tab>
<umb-tab id="tab2" rel="kalle">
<div class="umb-pane">
This is tab content for tab 2
</div>
</umb-tab>
</umb-tab-view>
</umb-panel>
</div>
うまく機能しますが、ビジネスロジックをビューから別のファイルに移動したいです。JS コードを別のファイルに移動して、次のようにリンクしようとしました。
<script type="text/javascript" src="Controllers/StoreEditController.js"></script>
そして、Angular は私のコントローラーをアプリに挿入したくありません。コントローラーを別のファイルに移動して、ビューでこれにリンクするにはどうすればよいですか? 出来ますか?
すみません、英語でお願いします。よろしく、 アントン