I have created my new custom section for Umbraco 7 backend. Now I have created edit.html file property editor purpose with code:
<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>
And it works well, but I want move business logic from view to separate file. I have tried to move JS code to separate file, and make link to it like this:
<script type="text/javascript" src="Controllers/StoreEditController.js"></script>
And Angular doesn't want to inject my controller into app. How I can move controller to separate file and make link to this in my view? Is it possible?
Excuse my English please. Regards, Anton