Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Wim Huiskes
@wimhuiskes
is angular worth my time to learn?
Frederik Prijck
@frederikprijck
Hey @wimhuiskes .
Depends on what you're plans are with it, but I'd say it's worth it.
Looking for Angular 1 or 2 tho ? :) They're both awesome, but well ... ng2 is new.
Wim Huiskes
@wimhuiskes
i bought a book today, its about 1
Frederik Prijck
@frederikprijck
Depending on your JavaScript knowledge, I'd even start learning 2.
Wim Huiskes
@wimhuiskes
i want to build an app, that stores data, and sents that data by mail to the owner of the app
Frederik Prijck
@frederikprijck
But if you're new to JavaScript aswell, you might wanna start off learning 1.
Wim Huiskes
@wimhuiskes
i am not new to javascripy
t
Frederik Prijck
@frederikprijck
It's not about being new, it's about whether or not you're familiar with modern JavaScript using ES6, Module bundlers etc.
Wim Huiskes
@wimhuiskes
but i think that what i want to build is more backend
i am not familiar with FS6
Frederik Prijck
@frederikprijck
So start with Angular1. :D
Wim Huiskes
@wimhuiskes
but is it possible to build the app i want?
should be easy………..i think (:
Frederik Prijck
@frederikprijck
Angular isn't going to help you store the data and mail the owner.
Wim Huiskes
@wimhuiskes
that would be php
Frederik Prijck
@frederikprijck
Angular is only html/css and JS.
Wim Huiskes
@wimhuiskes
is there any online resource where i can start?
Frederik Prijck
@frederikprijck
Wim Huiskes
@wimhuiskes
@frederikprijck thanks :smile:
Frederik Prijck
@frederikprijck
Goodluck @wimhuiskes !
Wim Huiskes
@wimhuiskes
thanks and nice to meet :smile:
i am from holland, so we are neighbours
Frederik Prijck
@frederikprijck
Yep, I know :D
Ayush Bahuguna
@relentless-coder
@frederikprijck hey, I need help. so, i read a little bit on angular js and watched a few videos on pluralsight. I have been able to store the data of my form, but I can't log it to my console.
Frederik Prijck
@frederikprijck
console.log works. So dus $log.debug
Ayush Bahuguna
@relentless-coder
app.controller("FormCtrl", ["$scope", "$location", "$window", "dataService", function($scope, $location, $window, dataService) {

    $scope.newuser = dataService.details;
    $scope.submit = function() {
      dataService.submitInfo();
    }

       if(document.getElementById('showPswd')) {
      document.getElementById('showPswd').addEventListener("click", function() {
          var pwd = document.getElementById("newPassword");
          if (pwd.getAttribute("type") === "password") {
              pwd.setAttribute("type", "text");
          } else {
              pwd.setAttribute("type", "password");
          }
      });
    }
    if(document.getElementById('last')) {
      console.log(dataService.newuser);
          setTimeout(function() {
            $window.open('http://www.ayushdevelops.com/');
          }, 10000);
    }

    $scope.go = function(path) {
      $location.path(path);
    };
}]);

app.service('dataService', function() {
  var userData = this;
  userData.details = {
    "firstname": '',
    "lastname": '',
    "email": '',
    "number": '',
    "password": '',
    "aadhar": '',
    "pan": ''
  }
  userData.submitInfo = function(){
    console.log(userData.details.firstname);
  }
})
Frederik Prijck
@frederikprijck
You dont want code like this in ur controller: if(document.getElementById('showPswd'))
Ayush Bahuguna
@relentless-coder
well, i am seeing undefined in my console. however the dataService.details is storing values, without loosing them when a new view enters.
Frederik Prijck
@frederikprijck
console.log(dataService.newuser); this will log undefined
Ayush Bahuguna
@relentless-coder
where should I put it then?
Frederik Prijck
@frederikprijck
can u change it to: console.log(dataService.details);
That will give you the result.
Ayush Bahuguna
@relentless-coder
I don't have console.log(dataService.newuser) in my code
Frederik Prijck
@frederikprijck
You do.
Atleast I see it in the code you showed me.
blob
Ayush Bahuguna
@relentless-coder
oh no. I didn' t see that. I am so sorry. i must have forgot to remove that. I had this in my service console.log(userData.details.firstname);
Frederik Prijck
@frederikprijck
But that's not loggin undefined, is it ?
Ayush Bahuguna
@relentless-coder
it is logging undefined. Let me try again though, I had just one thing logged in my console. that's undefined, let me try again give me a min
Frederik Prijck
@frederikprijck
If it is, create a plunkr. I can't help you without one.
Ayush Bahuguna
@relentless-coder
now it is logging nothing.
the problem with creating a plunkr is that it is a form, and you'd have to enter data into it. Last time we went through that, you didn't like it
my dataService.details is storing data correctly. because i have inserted data binding expressions in each view, and as I can see it stores the data correctly. I am calling the submit function through ng-click on the final section.
Ayush Bahuguna
@relentless-coder
the main problem is that i don't see any error either.
Frederik Prijck
@frederikprijck
@relentless-coder I don't mind a form in a plunkr, I just dont like a 5 step form with a bug in the last step making me submit each step before I can test the problem.
now it is logging nothing.