Giter Club home page Giter Club logo

angularjs1's People

Contributors

simonmackie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angularjs1's Issues

Unit Tests from chapter 9

Sorry for another noob question, but I can't get the unit tests from chapter 9 to pass, it seems the problem occurs when calling '$httpBackend.flush();', I even tried copying across the unit test from the final codebase sample (remembering to comment out the 'afterEach' blocks), but still get the same error:

http://cl.ly/image/3f3T1c2M3m1v

spBlogger generates error

I've downloaded the code and made the updates according to the book (Chapter 6) and I get this error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module spBlogger due to:
Error: [$injector:modulerr] Failed to instantiate module spBlogger.posts due to:
Error: [$injector:unpr] Unknown provider: $stateProvider
http://errors.angularjs.org/1.3.0-beta.2/$injector/unpr?p0=%24stateProvider
at http://localhost:8000/lib/angular/angular.js:78:12
at http://localhost:8000/lib/angular/angular.js:3596:19
at getService (http://localhost:8000/lib/angular/angular.js:3723:39)
at Object.invoke (http://localhost:8000/lib/angular/angular.js:3750:13)
at http://localhost:8000/lib/angular/angular.js:3679:37
at Array.forEach (native)
at forEach (http://localhost:8000/lib/angular/angular.js:322:11)
at loadModules (http://localhost:8000/lib/angular/angular.js:3666:5)
at http://localhost:8000/lib/angular/angular.js:3673:40
at Array.forEach (native)
http://errors.angularjs.org/1.3.0-beta.2/$injector/modulerr?p0=spBlogger.po…ngular%2Fangular.js%3A3673%3A40%0A%20%20%20%20at%20Array.forEach%20(native)
at http://localhost:8000/lib/angular/angular.js:78:12
at http://localhost:8000/lib/angular/angular.js:3700:15
at Array.forEach (native)
at forEach (http://localhost:8000/lib/angular/angular.js:322:11)
at loadModules (http://localhost:8000/lib/angular/angular.js:3666:5)
at http://localhost:8000/lib/angular/angular.js:3673:40
at Array.forEach (native)
at forEach (http://localhost:8000/lib/angular/angular.js:322:11)
at loadModules (http://localhost:8000/lib/angular/angular.js:3666:5)
at createInjector (http://localhost:8000/lib/angular/angular.js:3606:11)

$stateProvider is set in app/modules/postModule.js
Can somebody help me figure out where I went off the rails?

Chapter 11, tests not passed

Im having problem passing the tests;

I always get the same on the console:

"FAILED Directive Test Should initialize comments div with 2 comments"

I followed all steps on the book and still, getting this all the time.

I suspect is because -> elem.find('.single-comment').length returns 0; so I think comments are not mocked properly.

Any help in here ?

PS: The book is awesome, but the code... well... would be nice if book and repository match.

Cannot follow the code walk through from chapter 6

Hello Sandeep,

I found your book pretty awesome...but i have really hard time following with the code walk through from chapter 6 and on...as i can image many people...I read your answer on billhannah but i am still facing problems...for example ui.router isn't mentioned nor is the bootstrap.css file as it is missing from chapter 2 zip file.

I would love if you could go through the process again and have a more clear walk through for us to follow.

Regards.
Mat

running the test.bat file in scripts folder outputs "TypeError: Cannot read property 'prototype' of undefined"

When I run test.bat from the sp-blogger scripts folder i get the following error: it seems like EventEmitter is undefined. Everything works fine if I run test.bat with an older version of node js specifically 6.12.2, but if I try with the LTS latest version (8.9.3) it outputs the following error: what do I need to do to fix this? it seems like something is depreciated with the latest version of node js, probably EventEmitter??? Thanks.

`C:\Users\Yanni\Desktop\angularjs1-master\Ch 02\sp-blogger>scripts\test.bat
C:\Users\Yanni\Desktop\angularjs1-master\Ch 02\sp-blogger\node_modules\karma\node_modules\socket.io\lib\store.js:35
Store.prototype.proto = EventEmitter.prototype;
^

TypeError: Cannot read property 'prototype' of undefined
at Object. (C:\Users\Yanni\Desktop\angularjs1-master\Ch 02\sp-blogger\node_modules\karma\node_modules\socket.io\lib\store.js:35:42)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Yanni\Desktop\angularjs1-master\Ch 02\sp-blogger\node_modules\karma\node_modules\socket.io\lib\manager.js:16:13) at Module._compile (module.js:635:30)`

Code in this project does not match what is stated in book

I'm working through the Angular JS - Novice To Ninja book. In Chapter 2 the book says to download the sample application, but does not tell you how or where. I have to assume this is the location it is talking about. If so, these code examples do not match what is stated in the book. So far I've noticed when trying to work through Chapter 6:

  1. I am using the code from the Ch 02 folder (as there is no Ch 06)
  2. Calling node script/web-server.js does not work as described. The app/ directory is not set as the home directory. Also, the script does not assume / is /index.html. The book says to get the updated version but not from where.
  3. Some files are missing such as the bootstrap css and modules/posts/css/posts.css

First example in book is out of date

I found the start of Chapter 1 very frustrating because you sit down and are ready to learn Angular and the very first experience is Angular.js not working. After messing around for a while I sorted out why the code included in the book does not work with the latest version of Angular. Hope this helps unblocks other developers jumping into Angular.JS who purchased the book.

While the book could use an update, I recommend validating any of the core method calls here:
https://docs.angularjs.org/guide/

app/test.html

<!doctype html>
<html lang="en" ng-app="myApp">
<head>
  <meta charset="utf-8">
  <title>Finance Meter</title>
  <link rel="stylesheet" href="css/app.css"/>
</head>

<body ng-controller="FinanceController">
  Your Salary?
  <input type="text" ng-model="salary">
  <br/>How much should you invest in shopping?
  <input type="text" ng-model="percentage">%
  <br/>The amount to be spent on gadgets will be: <span>{{result()}}</span>

  <!-- In production use:
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
  -->
  <script src="lib/angular/angular.js"></script>
  <script src="lib/angular/angular-route.js"></script>
  <script src="js/app.js"></script>
  <script src="js/services.js"></script>
  <script src="js/controllers.js"></script>
  <script src="js/filters.js"></script>
  <script src="js/directives.js"></script>
</body>

</html>

app/js/app.js

'use strict';

// Declare app level module which depends on filters, and services
angular.module('myApp', [
  'myApp.controllers'
]);

app/js/controllers.js

angular.module('myApp.controllers', []).
  controller('FinanceController', ['$scope', function($scope) {
    $scope.salary = 0;
    $scope.percentage = 0;
    $scope.result = function() {
      return $scope.salary * $scope.percentage * 0.01;
    };
  }]);

Unauthorized (API Calls to rhcloud)

I have been playing with the exercises from chapter 9, I get read and update data in the rhcloud spBlogger API, but I can't seem to be allowed to delete or create new entries, am I doing something wrong? Or is the API protected against delete and post verbs?

sh scripts/test.sh

'sh' is not recognized as an internal or external command, operable program or batch file.

Solution?

Unit tests

Hi there, great book, however, I am not being able to run the last set of unit tests from page 124, in the PostDetailsController test, the 'it' part of the test injects $state and $stateParams, for some reason, the $stateParam can be injected correctly, however, the $state cannot, I triple checked and angular ui is present in my karma.conf and in my beforeEach()

http://cl.ly/image/1i0u3w2m1Z21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.