Skip to content

Commit

Permalink
correção com versão nova do angular
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmirandaalmeida committed Jul 21, 2017
1 parent 4d7b26b commit 4266551
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 23 deletions.
12 changes: 12 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ angular
console.log(login)
}


$scope.pedido = {
"cliente": "mateus",
"itens": [{}]
}

$scope.$watch('pedido', function(pedido){

console.log(pedido)

}, true);

$scope.exemplo = {
fields: [
{
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gumga-login",
"version": "2.5.1",
"version": "2.6.0",
"homepage": "https://github.com/GUMGA/login",
"authors": [
"Gui Seek <guiseek@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion dist/gumga-login.min.js

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<title>Gumga Studio</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="dist/gumga-login.min.css">
<link rel="stylesheet" href="dist/gumga-login.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/node_modules/angular/angular.min.js"></script>
<script src="app.js"></script>
<script src="dist/gumga-login.min.js"></script>
<script src="dist/gumga-login.js"></script>
<!-- <script src="gumga-login.js"></script> -->
</head>
<body ng-controller="LoginController">
Expand All @@ -33,6 +33,11 @@
on-login="onLogin(user, organizations)"
register="exemplo"
configuration="configuration">
<gl-login-facebook app-key="43242" on-login="login(data)"></gl-login-facebook>
<gl-login-google app-key=""
on-login="login(data)"
client-id="">
</gl-login-google>
</gl-login>

<!-- <gl-login
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gumga-login",
"version": "2.5.1",
"version": "2.6.0",
"description": "Gumga Login",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -39,6 +39,6 @@
"webpack-stream": "^3.2.0"
},
"dependencies": {
"angular": "^1.5.8"
"angular": "^1.6.4"
}
}
19 changes: 11 additions & 8 deletions src/components/facebook/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ let Facebook = {
controller: ['FacebookFactory', '$transclude', function(FacebookFactory, $transclude) {
let ctrl = this;

FacebookFactory.setLang('pt_BR') // set lang
FacebookFactory.init({
appId: ctrl.appKey, // required, default = null
status: true, // optional, default = true
cookie: false, // optional, default = false
xfbml: false, // optional, default = false
version: 'v2.4' // optional, default = v2.4
})
ctrl.$onInit = () => {
FacebookFactory.setLang('pt_BR') // set lang

FacebookFactory.init({
appId: ctrl.appKey, // required, default = null
status: true, // optional, default = true
cookie: false, // optional, default = false
xfbml: false, // optional, default = false
version: 'v2.4' // optional, default = v2.4
})
}

ctrl.me = facebookStatus => {
FacebookFactory.api('/me', {
Expand Down
5 changes: 4 additions & 1 deletion src/components/header/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ let HeaderComponent = {
`,
controller: [function() {
let ctrl = this;
ctrl.menus = ctrl.menus || [];

ctrl.$onInit = () => {
ctrl.menus = ctrl.menus || [];
}

}]
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/login/component.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let LoginComponent = {
bindings: {
onLogin: '&',
configuration: '=',
register: '='
onLogin: '&?',
configuration: '=?',
register: '=?'
},
transclude: true,
template: `
Expand Down Expand Up @@ -126,7 +126,7 @@ let LoginComponent = {
</section>
`,
controller: ['GumgaLoginService', '$timeout', function(GumgaLoginService, $timeout) {
controller: ['GumgaLoginService', '$timeout', '$scope', function(GumgaLoginService, $timeout, $scope) {
let ctrl = this;
ctrl.loginText = 'Entrar';
ctrl.changeOrganizationText = 'Continuar';
Expand Down Expand Up @@ -155,9 +155,13 @@ let LoginComponent = {

ctrl.updateStep('LOGIN');

$scope.$watch('$ctrl.configuration', () => {
GumgaLoginService.initConfiguration(ctrl.configuration);
}, true);

ctrl.$onInit = () => {
if(!ctrl.configuration){
throw "Please enter the setup object for the gumga login.";
console.error("Please enter the setup object for the gumga login.");
}
GumgaLoginService.initConfiguration(ctrl.configuration);
}
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const baseName = "gumga-login";

module.exports = {
entry: path.join(__dirname, 'src/components', 'index'),
entry: path.join(__dirname, 'src/components/', 'index'),
output: {
path: path.join(__dirname, 'dist/'),
filename: baseName+'.js',
publicPath: '/dist/'
},
watch: true,
devServer: {
inline: true,
port: 1111
Expand Down
2 changes: 1 addition & 1 deletion webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const baseName = "gumga-login";

module.exports = {
entry: path.join(__dirname, 'src', 'components/index'),
entry: path.join(__dirname, 'src/components', 'index'),
output: {
path: path.join(__dirname, 'dist/'),
filename: baseName + '.min.js'
Expand Down

0 comments on commit 4266551

Please sign in to comment.