Skip to content

Commit 66e7554

Browse files
author
Owen Melbourne
committed
moved ng-app directive up a level so it can be used multiple times
1 parent 52bd27d commit 66e7554

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/resources/views/create.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@endsection
1515

1616
@section('content')
17-
<div class="row">
17+
<div class="row" ng-app="backPack">
1818
<div class="col-md-8 col-md-offset-2">
1919
<!-- Default box -->
2020
@if ($crud->hasAccess('list'))

src/resources/views/edit.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@endsection
1515

1616
@section('content')
17-
<div class="row">
17+
<div class="row" ng-app="backPack">
1818
<div class="col-md-8 col-md-offset-2">
1919
<!-- Default box -->
2020
@if ($crud->hasAccess('list'))

src/resources/views/fields/table.blade.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
2424
?>
25-
<div ng-app="backpackTable" ng-controller="tableController" @include('crud::inc.field_wrapper_attributes') >
25+
<div ng-controller="tableController" @include('crud::inc.field_wrapper_attributes') >
2626

2727
<label>{!! $field['label'] !!}</label>
2828

@@ -66,7 +66,7 @@
6666

6767
</table>
6868

69-
<div class="array-controls btn-group">
69+
<div class="array-controls btn-group m-t-10">
7070
<button class="btn btn-sm btn-default" type="button" ng-click="addItem()"><i class="fa fa-plus"></i> Add {{ $item_name }}</button>
7171
</div>
7272

@@ -96,11 +96,13 @@
9696
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
9797
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-sortable/0.14.3/sortable.min.js"></script>
9898
<script>
99-
angular.module('backpackTable', ['ui.sortable'], function($interpolateProvider){
99+
100+
window.angularApp = window.angularApp || angular.module('backPack', ['ui.sortable'], function($interpolateProvider){
100101
$interpolateProvider.startSymbol('<%');
101102
$interpolateProvider.endSymbol('%>');
102-
})
103-
.controller('tableController', function($scope){
103+
});
104+
105+
window.angularApp.controller('tableController', function($scope){
104106
105107
$scope.sortableOptions = {
106108
handle: '.sort-handle'

0 commit comments

Comments
 (0)