2017-02-06 2 views
1

나는 과정 Staying Sharp With AngularJs을 따라 가고 있습니다.각도 경로 URL 작성 사용 #!/issue

과정은 app.ts의 일부 코드를 넣어 :

angular 
    .module("NoteWrangler", ["ngRoute"]) 
    .config(function ($routeProvider: angular.route.IRouteProvider) { 
     $routeProvider 
      .when("/notes", { 
       templateUrl: "templates/pages/notes/index.html" 
      }); 
    }); 

확인을하기 때문에 링크는 다음과 같이 형성된다 :

somedomain/index.html/#/myPage 

을하지만 할 때 내 URL은 다음과 같이 만들 수 있습니다 :

somedomain/index.html#!/myPage 

왜 다른가요?
".../#/...""...#!/..." 사이에 있음을 의미합니다.
어떻게이 두 가지를 변경할 수 있습니까?

답변

2

왜 다른가요?

구식 버전은 #입니다.

몇 년 전만해도 #!으로 변경되었으므로 (지금은 사용되지 않음) Google Ajax crawling spec과 잘 어울립니다.

1

각도에서는 새틴 (shebang)이라고 불리우며 ngroute 클래스와 긴밀하게 협력합니다. This topic에는 정교한 답변이 포함되어 있습니다.