Code Monkey home page Code Monkey logo

Comments (2)

fogil avatar fogil commented on June 17, 2024

Found the solution to my problem.

app.config(function ($routeProvider) {
  $routeProvider.when('/', {
    controller: 'TasksController',
    templateUrl: 'view1.html'
  }).when('/view2', {
    controller: 'TasksController',
    templateUrl: 'view2.html'
  }).otherwise({
    redirectTo: '/'
  })
})

Basically, the templateUrl should just be the filename, regardless of where or how deeply nested the template file is.

My view2.html is actually located at RAILS_ROOT/app/assets/javascripts/templates/arbitary_directory/view2.html

This leads to the question of, what if there exists two or more templates with the same name? Since they share the same key -- one has to override the other. This is a bug with this gem.

from angular-rails-templates.

dmathieu avatar dmathieu commented on June 17, 2024

You can't have two or more templates with the same name, or you're using a very weird filesystem.
Templates in subfolders wille be named subfolder/view.html.

from angular-rails-templates.

Related Issues (20)

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.