dongzhi1822 2014-01-30 15:19
浏览 100

Laravel和Angularjs偏见

I have a fairly simple app that filters a list of products.

Laravel creates the JSON feed for the products that I am reading and outputting with Angular and Laravel returns a filtered list based on what a user selects in a detailed filter form.

I have a requirement now that as a user filters results that the URL is changed in the browser and if the copy and paste it or share the link that they will be able to see the same results when the visit the app.

To do this I'll need to create routes with Angular and make use of angular partials. From reading the angular docs and watching a few screencasts it seems I need to reference partials that are html files.

Since I'm doing this with Laravel I've been using a Laravel view for my main view and using angular template tags within it and that works fine. If I want to start using partials how should I go about this? Where do I put the partials and can I reference them in my main laravel view?

Thanks!

  • 写回答

1条回答 默认 最新

  • dsxgby126001 2014-01-30 15:40
    关注

    Can you provide any samples of your views code?

    You might find this helpful when working with Blade and Angular.js

    http://scotch.io/bar-talk/quick-tip-using-laravel-blade-with-angularjs

    If you could provide some code it would make it easier to help, I don't quite understand what you're attempting to do.

    You should be able to use ng-include anywhere in your Blade view.

    You can use $location to change the URL, though I'm not sure how it will handle a lot of changes in quick succession.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题