<!DOCTYPE html>
<html>
<head>
<script data-main="main" src="http://requirejs.org/docs/release/2.1.14/minified/require.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body account>
<account-registration>
<!-- ^directive
v templateUrl -->
</account-registration>
</body>
</html>
/* Styles go here */
label{
display: block;
}
define([
'require'
, 'angular'
, 'apps_init'
, 'account.directive'
, 'account.controller'
] , function(require, angular, apps_init){
var registration = apps_init;
return registration
.controller("AccountController", require('account.controller'))
.directive("accountRegistration", require('account.directive'))
});
define([
'angular'
] , function(angular){
// var apps = {};
// apps.form = angular.module('registration', [])
// .config(function($interpolateProvider) {
// $interpolateProvider.startSymbol('[[');
// $interpolateProvider.endSymbol(']]');
// });
return angular.module('registration', [])
.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
});
define ([
'apps_init'
] , function (apps) {
"use strict";
var registration = apps;
console.log(apps);
registration.directive('accountRegistration', function() {
return {
restrict: "E"
, scope: {}
, controller: 'AccountController'
, controllerAs: 'AccountController'
, templateUrl : 'account.html'
}
});
});
define([
'angular'
, 'registration'
], function(angular, registration){
angular.bootstrap(document.body, [registration.name]);
});
requirejs.config({
baseUrl: ''
, paths: {
// deps
"angular" : "https://code.angularjs.org/1.3.0-beta.5/angular"
}
, shim: {
'angular': { exports: 'angular'}
}
});
requirejs(['app_bootstrap'], function(app_bootstrap){});
define(
['angular']
, function (angular) {
"use strict";
return ['$scope', '$element', function($scope, $elem){
this.exists = 'true';
this.account = {};
this.scope = $scope;
$scope.change = function(){
alert(this.account);
}
return this;
}];
});
define (['apps_init', 'user.controller'], function (apps, userController) {
"use strict";
var form = apps;
return form.directive('fabUser', function() {
return {
restrict : "E"
, transclude : true
, scope : {}
, link: function(scope, elem, attrs){}
, templateUrl : 'ang/registration/step_one.html'
, controller : userController
};
});
});
define (['angular'],function (angular) {
"use strict";
return ['$scope', '$element', function($scope, $elem){
this.user = $scope;
this.user.contact ={
email : 'enter your email address'
, pw : ''
, phone : ''
, fax : ''
, mobile: ''
, inform : ''
};
this.user.confirm = {
email : ''
, password : ''
};
this.user.update = function(scope) {
// user.contact = this.user.contact;
scope.contact = $scope.contact;
// scope.contact.email = $scope.contact.email;
if(typeof scope.contact !== 'undefined'){
} else {
console.log()
}
};
$elem.on('blur keyup', function(thing) {
});
return this;
}];
});
<div class = "registration" ng-controller = "AccountController as account">
<label class = "form_field radiobox" >
<input
id = "account_exists" class = "radiobox-input" name = "account_exists"
type = "radio" value = "true" ng-value = "true"
ng-model = "account.exists" ng-change="change(account.exists)"
/>
<span>exists</span>
</label>
<label class = "form_field radiobox" >
<input
id = "no_account" class = "radiobox-input" name = "account_exists"
type = "radio" value = "false" ng-value = "false"
ng-model = "account.exists" ng-change="change(account.exists)"
/>
<span>doesn't exist</span>
</label>
[[account.exists ]]
</div>