I am new to gulp and angular 1.3. The same modules that work with a grunt 
build process and angular 1.2.x work as expected when built. The modules 
work when I am doing a "gulp serve". They do not work when I do a "gulp 
build" or "gulp serve:dist". I am not sure where the bug is, but it is 
happening when the js files are recreated in the .tmp directory.

As a  test, I created a new project with generator-gulp-angular 
- https://github.com/Swiip/generator-gulp-angular. The only thing I changed 
was replacing the existing generated navbar component with my own and 
replacing the index.html referrence to the src. My component looks like:

$project/src/app/components/navbar:
- _navbar.scss
- navbar.html
- navbar.js

I have simplified navbar.js to only be:

(function () {


  'use strict';


  function Navbar() {
    return {
      foo: function() {
        return true;
      }
    };
  }


  function appNavbar(Navbar) {
    function link($scope) {
    }
    return  {
      restrict: 'E',
      replace: true,
      scope: {
      },
      link: link,
      templateUrl: 'components/navbar/navbar.html'
    };
  }


  angular.module('app.navbar', [])
    .factory('Navbar', Navbar)
    .directive('appNavbar', appNavbar)
  ;


})();


Note: I have tried different ways to structure the JS file and still the 
result below gets created.

This results in an incorrect js file in the .tmp directory 
($project/.tmp/app/components/navbar):

(function(module) {
try {
  module = angular.module('app');
} catch (e) {
  module = angular.module('app', []);
}
module.run(['$templateCache', function($templateCache) {
  $templateCache.put('components/navbar/navbar.html',
    '<div><top-bar></top-bar></div>');
}]);
})();


What in the gulp build process would be causing this?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to