angular.module('app', [
'ui.router',
'ui.bootstrap',
- 'ui.bootstrap.modal'
+ 'ui.bootstrap.modal',
+
+ /* Feature areas */
+ 'app.welcome'
]);
}());
--- /dev/null
+(function () {
+ 'use strict';
+
+ angular
+ .module('app.welcome')
+ .controller('Welcome', Welcome);
+
+ /* @ngInject */
+ function Welcome() {
+ var vm = this;
+
+ vm.hello = 'Hello World';
+ }
+
+})();
--- /dev/null
+describe('app.welcome', function() {
+ 'use strict';
+
+ var controller, scope;
+
+ beforeEach(function() {
+ module('app.welcome');
+
+ inject(function($controller, _$rootScope_) {
+ scope = _$rootScope_.$new();
+ scope.hello = 'Hello World';
+ controller = $controller('Welcome', {$scope: scope});
+ });
+ });
+
+ describe('Welcome controller', function () {
+
+ it('should be created successfully', function () {
+ expect(controller).toBeDefined();
+ });
+ });
+
+});
<!DOCTYPE html>
-<div class="container" ng-controller="WelcomeController as welcomeController">
+<div class="container" ng-controller="Welcome as welcome">
<div class="row">
+ {{ welcome.hello }}
+
<div class="col-md-2">
</div>
<div class="col-md-10">
--- /dev/null
+(function() {
+ 'use strict';
+
+ angular.module('app.welcome', []);
+
+})();
<!-- Custom JavaScript -->
<!-- build:js({.tmp,app}) js/app.js -->
<!-- inject:js -->
+ <script src="/src/showcase/app/welcome/welcome.module.js"></script>
<script src="/src/showcase/app/welcome/welcome.controller.js"></script>
<script src="/src/showcase/app/app.module.js"></script>
<script src="/src/showcase/app/app.config.js"></script>
This could be useful when using different frameworks in the same html application where one framework
works with some DOM elements and another framework works with other DOM elements.
-->
- <div ng-app="app" ng-strict-di>
- <div ui-view></div>
+ <div ng-app="app">
<div>
<ui-view>
<i>Hello World!!! You should never see this message if ui-router works as expected.</i>