Jefferson William | 27 Jul 02:30 2013
Picon

Uncaught Error: No module: myApp

Olá pessoal,


Estou com um problema para carregar meu modulo (myApp) usando AngularJS, RequireJS e CoffeeScript, e via backend CakePHP 2.x.

Segue meu código simplificado para melhor visualização:

angular.ctp - está servindo como meu "index.html" por exemplo.

<!DOCTYPE html>
<html lang="pt-br" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
        <!-- Carrego o script do RequireJS e logo após meu main.js onde estou carregando todos os outros scripts -->
        <?php echo $this->Html->script($this->Html->url('/components/requirejs/require.js', true), array('data-main' => $this->Html->url('/js/main.js', true))); ?>

main.coffee

require.config
paths:
jquery: '../components/jquery/jquery'
bootstrap: 'vendor/bootstrap'
angular: '../components/angular/angular'
angularResource: '../components/angular/angular-resource'
shim:
bootstrap:
deps: ['jquery']
angular:
deps: ['jquery']
exports: 'angular'
angularResource:
deps: ['angular']
app:
deps: ['angularResource']
priority: ['angular']

require [
'jquery'
'bootstrap'
'angular'
'angularResource'
'app'
], (jquery, bootstrap, angular, angularResource, app) ->
angular.bootstrap(document,['myApp'])

app.coffee

define [
'angular'
'filters'
'services'
'directives'
'controllers'
], (angular, filters, services, directives, controllers) ->

myApp = angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers'])

myApp
.config(['$routeProvider', ($routeProvider) ->
$routeProvider
.when('/products/', { templateUrl: 'partials/products-index.html', controller: 'ProductsCtrl' })
.otherwise({redirectTo: '/'})
])

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Marcus Koosmann | 27 Jul 03:15 2013
Picon

ngSrc value persists even when there's no data for it

Hello - I'm using ngSrc for img tags and in my scope some objects have images and some don't, however once that ngSrc value is set, it wont go away until a new value takes it's place.  In other words, it doesn't detect if a new object doesn't have an image key and just keeps the old value.


Here's a fiddle showing the issue: http://jsfiddle.net/PANPJ/ (the first click will set the ngSrc value, but subsequent ones will never change it).

Obviously, there are work arounds for this and it would be best if my data set had a consistent set of values, but it still seems like an odd behavior.  

Any insight would be much appreciated!

Thanks,
-Marcus

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Roy Choo | 27 Jul 03:29 2013
Picon

unable to apply CSS3 :target styles with anchor links

Any advice?

satish venkatakrishnan | 27 Jul 07:50 2013
Picon

Re: List of models being used in directives in a DOM element and its children

Angularjs listens to all the variables in the $scope.. You can remove the variable from the $scope object if you don't want to listen
On Jul 27, 2013 3:21 AM, "Prashant Agrawal" <prashant <at> enthought.com> wrote:
>
> Hello all,
>
> Is there a way that I can tell which properties of scope are being used inside the tag that has ng-controller defined? 
>
> For example, given the following setup:
>
> <body ng-controller="BucketCtrl">
>    <div ng-repeat="item in items">
>        {{item.color}}
>    </div>
>    Bucket size is: {{size}}
>
>    <script>
>        function BucketCtrl($scope) {
>            $scope.size = 10;
>            $scope.items = [{color: "blue", name: "ball"}, {color: "green", name: "bat"}];
>            $scope.random_useless_info = "It is Friday today";
>        }
>    </script>
> </body>
>
> could I tell that the properties which are going to be used are of the following form?: 
> ['size', 'items[].color']
>
> I am writing an app which creates a bridge between a python model, and the html view with similar two way data bindings as angularjs has within the JS world, but I can't attach event handlers for changes to all the model properties in the python world, so I need to know beforehand which properties are actually being used in the html view, and attach only those properties.
>
> I noticed that scope has the $$watchers list. Does this list encompass watchers for all the child elements too or only the current element? Is there a standard way that this list can be used to extract data about which model properties are actually being watched?
>
> Any help is greatly appreciated. Thanks.
>
> Prashant
>
> --
> You received this message because you are subscribed to the Google Groups "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
> To post to this group, send email to angular <at> googlegroups.com.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Stu Salsbury | 27 Jul 08:05 2013
Picon

Re: Should I use the "var me = this" trick to access controller methods inside $scope methods?

Is there any reason why a good old fashioned function doesn't meet your needs?


I'm curious because unless you're doing prototypal inheritance of your controller (which would hopefully involve putting the function on the prototype :) ) then I can't think of a reason to expose it to the world (other than as a member of $scope).  But I'm really curious about what you might be able to do with it that I'm overlooking.


On Thursday, July 25, 2013 11:49:35 AM UTC-7, Dehru Cromer wrote:
Hello, 
I'm new to angular and having a blast with it.  

I don't want to pollute the scope with methods that the view doesn't need to know about.  So I want to define some minor business logic inside my controller like "this.functionName" and be able to call that from a function exposed on the $scope.  But I can't figure out how to call a method on the controller that is not defined on the scope because of the "this" being the $scope's scope when the method executes.

Is this advisable create a closure like this?  I wasn't sure if this kind of closure trick was a good idea or bloating the $scope.

Example on plunker


Thanks,
Dehru

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
paramaw | 27 Jul 08:28 2013

Re: Some help using Angular with Twitter Typeahead.js + understanding angular templates

Hi Ramin,


Were you able to solve this issue? I'm currently looking for a solution for this as well.

--Parama

On Sunday, June 2, 2013 8:45:52 PM UTC-4, Ramin Bozorgzadeh wrote:
Hey everyone,

I am new to Angular and learning (and liking) it so far. I am currently trying to integrate twitter's typeahead.js library while using angular js as the templating mechanism.

If you are unfamiliar with typeahead.js, it is a standalone autocomplete library that the twitter engineer team has created that has support for basic typeahead and autocomplete features with custom templating of results.

The documentation recommends using Hogan.js (another twitter project) as the template engine, but any template engine that adheres to their API will work. The engine needs to simply have a "compile" function that returns a compiled template object, which in turn has a "render" function that spits out the rendered result.

Ok, now that we have that all that information, what I am trying to do is utilize this typeahead library, but use AngularJS as the template engine. I've been able to use the $templateCache to load up an angular ngScript template and pass it to the typeahead library .. however, I am having a hard time getting it to render on the page and have the template maintain its "angular features" ... like the bindings and whatnot.

I have created a Stackoverflow question with some sample code to illustrate the problem. Any help would be greatly appreciated.


I guess another way to ask this question is ... how do you compile a custom template using ngScript and then append it to the DOM using angular, meanwhile having it maintain its bindings.

Thank you,
Ramin

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Roy Choo | 27 Jul 09:55 2013
Picon

Re: unable to apply CSS3 :target styles with anchor links

Providing a jsfiddle to illustrate. the css target styles are not applied when clicking on the href.



Regards
Roy


On Saturday, 27 July 2013 02:36:13 UTC+8, Roy Choo wrote:
Hi,

i am trying to style a box when user click on a link to go to that box.
I am trying to make use of CSS3 :target to do that.

But i cant seem able to do it.
any ideas?

below is a plnkr taken online and modified with :target

Regards
Roy

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Alexandre Boyer | 27 Jul 11:14 2013
Picon

Polymer v.s AngularJS

Hi,


Very simple question : Does Polymer.js will replace angularJS in your opinion ? and Why ?

The two frameworks are very similar in the features, i think one will replace the other ? What is the AngularJs point of vue ?
The Polymer point of vue is very evasive ... 

AB

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
庄有根 | 27 Jul 13:50 2013
Picon

can't get the instance from $injector.get()

I create my customer service named "greeting", but can't get it from $injector.get('greeting'). So what's the right way to get the service? Here is my code:

var app = angular.module('myDI', []);
app.provider('greeting', function(){
    this.$get = function(){
        return function(name) {
             console.log("Hello, " + name);
        };
    };
});

var $injector = angular.injector();
//here will throw error
var greeting = $injector.get('greeting');
greeting('angular');

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Luciano Amodio | 27 Jul 13:56 2013
Picon

Re: Weird value for select input using ng-model

for me the only working one is this solution cause select2 doesn't work well with ng-options



can you tell me more about this issue? it's solved but I don't like to use hacks without understand

On Saturday, November 17, 2012 3:19:08 AM UTC+4, Enda Diggins wrote:
I have to admit I was stumped there for a while!

It is logical for you to assume that the value in the <select ng-model=""> would be directly linked with the selected option but I am not sure that is the case (I am happy to be corrected!).

I think the answer to your problem, at least in the short-term, is found with ng-selected.

I have incorporated some changes to the code available here: http://jsfiddle.net/qq7xK/7/

It's a bit ugly but I hope it helps!

Best regards,
Enda


On Friday, 16 November 2012 22:12:34 UTC, wook... <at> gmail.com wrote:
Here's the info:
OS X 10.7.5 
Chrome 22.0.1229.94 and Firefox 16.0.2

The weird result is that the select box shows a blank option where if you inspect using developer tools has a value of "? string:2012-11-23 ?" instead of actually selecting the "one week" option which has a value of "2012-11-23". 





On Friday, November 16, 2012 2:03:09 PM UTC-8, enda diggins wrote:
Hey,

Could you include your browser & OS information? 

I'm using chrome 23.0.1271.64 on Ubuntu but can't see anything out of the ordinary on that fiddle.

Where exactly in the "Result" window are you seeing a problem?

Best regards,
Enda

On Friday, 16 November 2012 21:55:50 UTC, wook... <at> gmail.com wrote:
When I use ng-model on a select with options, the initial string value has a very strange format. The text input handles the model fine, just the select does some weird formatting.

"? string:2012-11-23 ?"

You can see the example here http://jsfiddle.net/qq7xK/2/

Any ideas why? Is it a bug in Angular?

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane