How to get and set cookies using angular and jquery

SET COOKIES JQUERY

< script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
< script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js">
$.cookie('username', $scope.username, { expires: 99, path: '/' });

GET COOKIES ANGULAR

 < script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
< script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-cookies.js">

var app = angular.module("myApp", ["ngRoute",'ngCookies']);
app.controller('myCtrl', function($window,$scope,$cookies) {

$scope.usercookies = $cookies.get('username');

});